org.springframework.instrument.classloading

## 类 InstrumentationLoadTimeWeaver

- java.lang.Object
- - org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver

- 所有已实现的接口:
    LoadTimeWeaver

      public class InstrumentationLoadTimeWeaver
      extends Object
      implements LoadTimeWeaver

  `LoadTimeWeaver` relying on VM `Instrumentation`.

  Start the JVM specifying the Java agent to be used, like as follows:

  `-javaagent:path/to/org.springframework.instrument.jar`

  where `org.springframework.instrument.jar` is a JAR file containing the `InstrumentationSavingAgent` class, as shipped with Spring.

  In Eclipse, for example, set the "Run configuration"'s JVM args to be of the form:

  `-javaagent:${project_loc}/lib/org.springframework.instrument.jar`

  从以下版本开始:
    2.0
  作者:
    Rod Johnson, Juergen Hoeller
  另请参阅:
    `InstrumentationSavingAgent`

- - ### 构造器概要

    构造器
    构造器和说明
    `InstrumentationLoadTimeWeaver()` Create a new InstrumentationLoadTimeWeaver for the default ClassLoader.
    `InstrumentationLoadTimeWeaver(ClassLoader classLoader)` Create a new InstrumentationLoadTimeWeaver for the given ClassLoader.

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addTransformer(ClassFileTransformer transformer)` Add a `ClassFileTransformer` to be applied by this `LoadTimeWeaver`.
    `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.
    `ClassLoader` | `getThrowawayClassLoader()` This implementation always returns a `SimpleThrowawayClassLoader`.
    `static boolean` | `isInstrumentationAvailable()` Check whether an Instrumentation instance is available for the current VM.
    `void` | `removeTransformers()` Remove all registered transformers, in inverse order of registration.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### 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()`