-
-
Save gokepler/e9d3beadbf439bf005b7a8c5eb2da759 to your computer and use it in GitHub Desktop.
Creating Spring AspectJ Proxy programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XuxuService service = new XuxuServiceImpl(); | |
| RetryAndNotifyOnErrorAspect myaspect = new RetryAndNotifyOnErrorAspect(); | |
| AspectJProxyFactory factory = new AspectJProxyFactory(service); | |
| factory.addAspect(myaspect); | |
| // factory.setProxyTargetClass(true); // if you're applying to a concrete class | |
| XuxuService proxy = factory.getProxy(); | |
| // just run it | |
| proxy.execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment