Created
March 27, 2021 09:52
-
-
Save mehmetcemyucel/bf5e02c78570d6d1a3baa670f62be33d to your computer and use it in GitHub Desktop.
spring-native-proxy
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
| public class Main { | |
| public static void main(String[] args) { | |
| ProxyFactory factory = new ProxyFactory(new SimplePojo()); | |
| factory.addInterface(Pojo.class); | |
| factory.addAdvice(new RetryAdvice()); | |
| Pojo pojo = (Pojo) factory.getProxy(); | |
| pojo.foo(); | |
| } | |
| } | |
| public class SimplePojo implements Pojo { | |
| public void foo() { | |
| ((Pojo) AopContext.currentProxy()).bar(); | |
| } | |
| public void bar() { | |
| // some logic... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment