类 TomcatInstrumentableClassLoader


  • public class TomcatInstrumentableClassLoader
    extends WebappClassLoader
    Extension of Tomcat's default class loader which adds instrumentation to loaded classes without the need to use a VM-wide agent.

    To be registered using a Loader tag in Tomcat's Context definition in the server.xml file, with the Spring-provided "spring-instrument-tomcat.jar" file deployed into Tomcat's "lib" directory. The required configuration tag looks as follows:

    <Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>

    Typically used in combination with a ReflectiveLoadTimeWeaver defined in the Spring application context. The addTransformer and getThrowawayClassLoader methods mirror the corresponding methods in the LoadTimeWeaver interface, as expected by ReflectiveLoadTimeWeaver.

    NOTE: Requires Apache Tomcat version 6.0 or higher, as of Spring 4.0. This class is not intended to work on Tomcat 8.0+; please rely on Tomcat's own InstrumentableClassLoader facility instead, as autodetected by Spring's TomcatLoadTimeWeaver.

    从以下版本开始:
    2.0
    作者:
    Costin Leau, Juergen Hoeller
    另请参阅:
    addTransformer(java.lang.instrument.ClassFileTransformer), getThrowawayClassLoader(), ReflectiveLoadTimeWeaver, TomcatLoadTimeWeaver