java - Whats the best way to inject same instance of service in service for Spring AOP -
i'va serviceimpl annotated @service stereotype of spring , have 2 methods in each 1 annotated custom annotations intercepted spring.
@service public class serviceimpl implements service{ @customannotation public void method1(){ ... } @anothercustomannotation public void method2(){ this.method1(); ... } } }
now spring uses proxy based aop approach , hence i'm using this.method1()
interceptor @customannotation not able intercept call, used inject service in factoryclass , in way able proxy instance -
@anothercustomannotation public void method2(){ somefactory.getservice().method1(); ... }
i'm using spring 3.0.x, best way proxy instance?
the other alternative use aspectj , @configurable. spring seems going towards these days (favoring).
i if using spring 3 faster (performance) , more flexible proxy based aop.
Comments
Post a Comment