hi ng,
could someone give me some hints on how to configure a proxy so that i can access the target object? eg:
thanks,Code:Cast cast = (Cast) proxy; Target = (Target) cast.getTargetObject();
cam
hi ng,
could someone give me some hints on how to configure a proxy so that i can access the target object? eg:
thanks,Code:Cast cast = (Cast) proxy; Target = (Target) cast.getTargetObject();
cam
Code:org.springframework.aop.framework.Advised
ok, but how can i access this from the proxy?
here was what i was thinking. I was going to add an introduction advice to the proxy:
but how can i gain access to the proxied object from the mixin?Code:public interface IProxy { public Object getProxiedObject(); }
Code:public class ProxyInterceptor extends DelegatingIntroductionInterceptor implements IProxy { public ProxyInterceptor() { super(); } public Object getProxiedObject() { // how can i return the proxied object here? } }thanks,Code:public class ProxyAdvisor extends DefaultIntroductionAdvisor { public ProxyAdvisor() { super(new ProxyInterceptor(), IProxy.class); } }
cam
If you want to get the target from the proxy, you do:
If you want to get the proxy from the target or advice, you set exposeProxy to true in the ProxyFactoryBean, and from your target or advice, you callCode:Advised advised = (Advised) proxy; Target target = proxy.getTargetSource().getTarget();GuillaumeCode:AopContext.currentProxy();
thanks that was exactly what i need to know!!![]()
cam