类 InstrumentationLoadTimeWeaver

java.lang.Object
cn.taketoday.instrument.InstrumentationLoadTimeWeaver
所有已实现的接口:
LoadTimeWeaver

public class InstrumentationLoadTimeWeaver extends Object implements LoadTimeWeaver
LoadTimeWeaver relying on VM Instrumentation. *

-javaagent:path/to/today-instrument-{version}.jar

In Eclipse, for example, add something similar to the following to the JVM arguments for the Eclipse "Run configuration":

-javaagent:${project_loc}/lib/today-instrument-{version}.jar

从以下版本开始:
4.0
作者:
Rod Johnson, Juergen Hoeller
另请参阅:
  • 构造器详细资料

    • InstrumentationLoadTimeWeaver

      public InstrumentationLoadTimeWeaver()
      Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.
    • InstrumentationLoadTimeWeaver

      public InstrumentationLoadTimeWeaver(@Nullable ClassLoader classLoader)
      Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.
      参数:
      classLoader - the ClassLoader that registered transformers are supposed to apply to
  • 方法详细资料

    • addTransformer

      public void addTransformer(ClassFileTransformer transformer)
      从接口复制的说明: LoadTimeWeaver
      Add a ClassFileTransformer to be applied by this LoadTimeWeaver.
      指定者:
      addTransformer 在接口中 LoadTimeWeaver
      参数:
      transformer - the ClassFileTransformer to add
    • getInstrumentableClassLoader

      public ClassLoader getInstrumentableClassLoader()
      We have the ability to weave the current class loader when starting the JVM in this way, so the instrumentable class loader will always be the current loader.
      指定者:
      getInstrumentableClassLoader 在接口中 LoadTimeWeaver
      返回:
      the ClassLoader which will expose instrumented classes according to the registered transformers
    • getThrowawayClassLoader

      public ClassLoader getThrowawayClassLoader()
      This implementation always returns a SimpleThrowawayClassLoader.
      指定者:
      getThrowawayClassLoader 在接口中 LoadTimeWeaver
      返回:
      a temporary throwaway ClassLoader; should return a new instance for each call, with no existing state
    • removeTransformers

      public void removeTransformers()
      Remove all registered transformers, in inverse order of registration.
    • isInstrumentationAvailable

      public static boolean isInstrumentationAvailable()
      Check whether an Instrumentation instance is available for the current VM.
      另请参阅:
      • getInstrumentation()