The Spring Framework

org.springframework.instrument.classloading
Class InstrumentationLoadTimeWeaver

java.lang.Object
  extended by org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
All Implemented Interfaces:
LoadTimeWeaver

public class InstrumentationLoadTimeWeaver
extends Object
implements LoadTimeWeaver

Load time weaver relying on Instrumentation. Start with java agent, with JVM options like: -javaagent:path/to/spring-agent.jar where spring-agent.jar is a JAR file containing the InstrumentationSavingAgent class.

In Eclipse, for example, set the Run configuration's JVM args to be of the form: -javaagent:${project_loc}/lib/spring-agent.jar

Since:
2.0
Author:
Rod Johnson
See Also:
InstrumentationSavingAgent

Constructor Summary
InstrumentationLoadTimeWeaver()
           
 
Method Summary
 void addTransformer(ClassFileTransformer transformer)
          Add a class file transformer to be applied by this load-time weaver.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentationLoadTimeWeaver

public InstrumentationLoadTimeWeaver()
Method Detail

addTransformer

public void addTransformer(ClassFileTransformer transformer)
Description copied from interface: LoadTimeWeaver
Add a class file transformer to be applied by this load-time weaver.

Specified by:
addTransformer in interface LoadTimeWeaver
Parameters:
transformer - the class file transformer 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.

Specified by:
getInstrumentableClassLoader in interface LoadTimeWeaver
Returns:
a class loader that supports instrumentation through AspectJ-style load-time weaving based on user-defined ClassFileTransformers

getThrowawayClassLoader

public ClassLoader getThrowawayClassLoader()
This implementation always returns a SimpleThrowawayClassLoader.

Specified by:
getThrowawayClassLoader in interface LoadTimeWeaver
Returns:
a temporary throwaway class loader; should return a new instance for each call, with no existing state
See Also:
SimpleThrowawayClassLoader

The Spring Framework

Copyright © 2002-2007 The Spring Framework.