Package org.apache.openjpa.enhance
Class InstrumentationFactory
- java.lang.Object
 - 
- org.apache.openjpa.enhance.InstrumentationFactory
 
 
- 
public class InstrumentationFactory extends Object
Factory for obtaining anInstrumentationinstance.- Since:
 - 1.0.0
 - Author:
 - Marc Prud'hommeaux
 
 
- 
- 
Constructor Summary
Constructors Constructor Description InstrumentationFactory() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidagentmain(String agentArgs, Instrumentation inst)The method that is called when a jar is added as an agent at runtime.static InstrumentationgetInstrumentation(Log log)static voidsetDynamicallyInstallAgent(boolean val)Configures whether or not this instance should attempt to dynamically install an agent in the VM.static voidsetInstrumentation(Instrumentation inst)This method is not synchronized because when the agent is loaded from getInstrumentation() that method will cause agentmain(..) to be called. 
 - 
 
- 
- 
Method Detail
- 
setInstrumentation
public static void setInstrumentation(Instrumentation inst)
This method is not synchronized because when the agent is loaded from getInstrumentation() that method will cause agentmain(..) to be called. Synchronizing this method would cause a deadlock.- Parameters:
 inst- The instrumentation instance to be used by this factory.
 
- 
setDynamicallyInstallAgent
public static void setDynamicallyInstallAgent(boolean val)
Configures whether or not this instance should attempt to dynamically install an agent in the VM. Defaults totrue. 
- 
getInstrumentation
public static Instrumentation getInstrumentation(Log log)
- Parameters:
 log- OpenJPA log.- Returns:
 - null if Instrumentation can not be obtained, or if any Exceptions are encountered.
 
 
- 
agentmain
public static void agentmain(String agentArgs, Instrumentation inst)
The method that is called when a jar is added as an agent at runtime. All this method does is store theInstrumentationfor later use. 
 - 
 
 -