I have an obsolete lib that instantiates BeanProxy . Unfortunately, this implementation has a flaw that I would like to fix. Since I do not want to start working with patched libraries, I would like to create an Aspect that completes the BeanProxy construct and returns an instance of my modified BeanProxy subtype.
I created the following Aspect and it is properly gossiped and called whenever a new BeanProxy instance is BeanProxy :
@Aspect public class CWebBeanProxyInjectingAspect { @Pointcut("execution(public flex.messaging.io.BeanProxy.new(..))") void createBeanProxy() {} @Around("createBeanProxy()") public Object createAlternateBeanProxy(final ProceedingJoinPoint pjp) throws Throwable { System.out.println("createAlternateBeanProxy"); final Object result = pjp.proceed(); System.out.println(result); return result; } }
Unfortunately, result always null ... what am I doing wrong? What do i need to change? It should be noted that I use AspectJ LoadTimeWeaving and spring -instrument-3.1.1.RELEASE.jar as an agent.
source share