Class ProxyReplacerTransformer


  • public class ProxyReplacerTransformer
    extends java.lang.Object
    Transforms Spring classes so the beans go through this plugin. The returned beans are proxied and tracked. The bean proxies can be reset and reloaded from Spring.
    Author:
    Erki Ehtla
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FACTORY_METHOD_NAME  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void replaceBeanWithProxy​(org.hotswap.agent.javassist.CtClass ctClass)  
      static void replaceCglibFastClassGenerator​(org.hotswap.agent.javassist.CtClass ctClass)
      Disable cache usage in FastClass.Generator to avoid 'IllegalArgumentException: Protected method' exceptions
      static void replaceSpringFastClassGenerator​(org.hotswap.agent.javassist.CtClass ctClass)
      Disable cache usage in FastClass.Generator to avoid 'IllegalArgumentException: Protected method' exceptions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FACTORY_METHOD_NAME

        public static final java.lang.String FACTORY_METHOD_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProxyReplacerTransformer

        public ProxyReplacerTransformer()
    • Method Detail

      • replaceBeanWithProxy

        @OnClassLoadEvent(classNameRegexp="org.springframework.beans.factory.support.DefaultListableBeanFactory")
        public static void replaceBeanWithProxy​(org.hotswap.agent.javassist.CtClass ctClass)
                                         throws org.hotswap.agent.javassist.NotFoundException,
                                                org.hotswap.agent.javassist.CannotCompileException
        Parameters:
        ctClass -
        Throws:
        org.hotswap.agent.javassist.NotFoundException
        org.hotswap.agent.javassist.CannotCompileException
      • replaceSpringFastClassGenerator

        @OnClassLoadEvent(classNameRegexp="org.springframework.cglib.reflect.FastClass.Generator")
        public static void replaceSpringFastClassGenerator​(org.hotswap.agent.javassist.CtClass ctClass)
                                                    throws org.hotswap.agent.javassist.NotFoundException,
                                                           org.hotswap.agent.javassist.CannotCompileException
        Disable cache usage in FastClass.Generator to avoid 'IllegalArgumentException: Protected method' exceptions
        Parameters:
        ctClass -
        Throws:
        org.hotswap.agent.javassist.NotFoundException
        org.hotswap.agent.javassist.CannotCompileException
      • replaceCglibFastClassGenerator

        @OnClassLoadEvent(classNameRegexp="net.sf.cglib.reflect.FastClass.Generator")
        public static void replaceCglibFastClassGenerator​(org.hotswap.agent.javassist.CtClass ctClass)
                                                   throws org.hotswap.agent.javassist.NotFoundException,
                                                          org.hotswap.agent.javassist.CannotCompileException
        Disable cache usage in FastClass.Generator to avoid 'IllegalArgumentException: Protected method' exceptions
        Parameters:
        ctClass -
        Throws:
        org.hotswap.agent.javassist.NotFoundException
        org.hotswap.agent.javassist.CannotCompileException