HotswapProjects/HotswapAgent

What is the ProxyReplacerTransformer in the Spring plugin used for?

wangjingf opened this issue · 1 comments

Related classes include these:

DetachableBeanHolder
EnhancerProxyCreater
HotswapSpringInvocationHandler
ProxyReplacer
ProxyReplacerTransformer
SpringHotswapAgentProxy
What is described in #51 is to enable spring's cglib proxy class hotswap, but I have been testing and understanding the code for a whole day. Without these codes and Proxy plugin, spring's proxy class hotswap still works well.(I even downloaded version 0.1-beta4-SNAPSHOT of HA before this feature, but Spring proxy swap still works fine)

My test code is like this(SpringBoot 2.3.2.RELEASE):

@Aspect
@Component
public class AnotherAspect {
    @Pointcut("execution(public * xx.AnotherService.service(..)) ")
    public void pointCut_search() {
    }

    @Around("pointCut_search()")
    public Object around_search(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        return proceedingJoinPoint.proceed();
    }
}

@Service
public class AnotherService {(implement or extends someting...)
    public String service() {
         //...
    }
//doing some add method, change method things...
}

can anyone help me?