类 InstrumentationLoadTimeWeaver
java.lang.Object
cn.taketoday.instrument.InstrumentationLoadTimeWeaver
- 所有已实现的接口:
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
- 另请参阅:
-
构造器概要
构造器构造器说明Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.InstrumentationLoadTimeWeaver(ClassLoader classLoader) Create a new InstrumentationLoadTimeWeaver for the given ClassLoader. -
方法概要
修饰符和类型方法说明voidaddTransformer(ClassFileTransformer transformer) Add aClassFileTransformerto be applied by thisLoadTimeWeaver.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.This implementation always returns aSimpleThrowawayClassLoader.static booleanCheck whether an Instrumentation instance is available for the current VM.voidRemove all registered transformers, in inverse order of registration.
-
构造器详细资料
-
InstrumentationLoadTimeWeaver
public InstrumentationLoadTimeWeaver()Create a new InstrumentationLoadTimeWeaver for the default ClassLoader. -
InstrumentationLoadTimeWeaver
Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.- 参数:
classLoader- the ClassLoader that registered transformers are supposed to apply to
-
-
方法详细资料
-
addTransformer
从接口复制的说明:LoadTimeWeaverAdd aClassFileTransformerto be applied by thisLoadTimeWeaver.- 指定者:
addTransformer在接口中LoadTimeWeaver- 参数:
transformer- theClassFileTransformerto add
-
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
ClassLoaderwhich will expose instrumented classes according to the registered transformers
-
getThrowawayClassLoader
This implementation always returns aSimpleThrowawayClassLoader.- 指定者:
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()
-