org.springframework.instrument.classloading

## 接口 LoadTimeWeaver

- 所有已知实现类:
    DefaultContextLoadTimeWeaver, GlassFishLoadTimeWeaver, InstrumentationLoadTimeWeaver, JBossLoadTimeWeaver, ReflectiveLoadTimeWeaver, SimpleLoadTimeWeaver, TomcatLoadTimeWeaver, WebLogicLoadTimeWeaver, WebSphereLoadTimeWeaver

      public interface LoadTimeWeaver

  Defines the contract for adding one or more `ClassFileTransformers` to a `ClassLoader`.

  Implementations may operate on the current context `ClassLoader` or expose their own instrumentable `ClassLoader`.

  从以下版本开始:
    2.0
  作者:
    Rod Johnson, Costin Leau
  另请参阅:
    `ClassFileTransformer`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addTransformer(ClassFileTransformer transformer)` Add a `ClassFileTransformer` to be applied by this `LoadTimeWeaver`.
    `ClassLoader` | `getInstrumentableClassLoader()` Return a `ClassLoader` that supports instrumentation through AspectJ-style load-time weaving based on user-defined `ClassFileTransformers`.
    `ClassLoader` | `getThrowawayClassLoader()` Return a throwaway `ClassLoader`, enabling classes to be loaded and inspected without affecting the parent `ClassLoader`.

- - ### 方法详细资料

    - #### addTransformer

          void addTransformer(ClassFileTransformer transformer)

      Add a `ClassFileTransformer` to be applied by this `LoadTimeWeaver`.
      参数:
        `transformer` - the `ClassFileTransformer` to add

    - #### getInstrumentableClassLoader

          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.

      返回:
        the `ClassLoader` which will expose instrumented classes according to the registered transformers

    - #### getThrowawayClassLoader

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

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