I'va ServiceImpl is annotated with the @Service Spring stereotype and has two methods: each of them is annotated with custom annotations that are intercepted by Spring.
@Service public class ServiceImpl implements Service{ @CustomAnnotation public void method1(){ ... } @AnotherCustomAnnotation public void method2(){ this.method1(); ... } } }
Now Spring uses the proxy-based AOP approach, and therefore, since I use this.method1() interceptor for @CustomAnnotation, it will not be able to intercept this call, we used this service in another FactoryClass, and thus we were able to get the proxy instance , eg -
@AnotherCustomAnnotation public void method2(){ someFactory.getService().method1(); ... }
Now I am using Spring 3.0.x, what is the best way to get a proxy server instance?
java spring spring-aop aop
Premraj Feb 23 '11 at 12:53 2011-02-23 12:53
source share