org.springframework.instrument.classloading

Interface LoadTimeWeaver

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addTransformer(java.lang.instrument.ClassFileTransformer transformer)
      Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
      java.lang.ClassLoader getInstrumentableClassLoader()
      Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.
      java.lang.ClassLoader getThrowawayClassLoader()
      Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.
    • Method Detail

      • addTransformer

        void addTransformer(java.lang.instrument.ClassFileTransformer transformer)
        Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
        Parameters:
        transformer - the ClassFileTransformer to add
      • getInstrumentableClassLoader

        java.lang.ClassLoader getInstrumentableClassLoader()
        Return a ClassLoader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers.

        May be the current ClassLoader, or a ClassLoader created by this LoadTimeWeaver instance.

        Returns:
        the ClassLoader which will expose instrumented classes according to the registered transformers
      • getThrowawayClassLoader

        java.lang.ClassLoader getThrowawayClassLoader()
        Return a throwaway ClassLoader, enabling classes to be loaded and inspected without affecting the parent ClassLoader.

        Should not return the same instance of the ClassLoader returned from an invocation of getInstrumentableClassLoader().

        Returns:
        a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state