Java Programing laungage

java.lang Projects

java.lang Project

java.lang Examples

java.lang Examples

Package java.lang.instrument

This package provides instrument services that allow java programming language agents to running instrument program on the Java Virtual machine (JVM).

Previous Home Next
InterfaceDescription
ClassFileTransformerThis interface is implemented by a agent in order to transform class files. The transformation occurs before the class is defined by the JVM.
InstrumentationInterface provide services needed to instrument Java programming language code. This is the addition of byte-codes to methods for the purpose of gathering data to be utilized by tools, since the changes are purely additive, these tools do not modify application state or behavior. There are two ways to obtain an instance of the Instrumentation interface:
  1. When a JVM is launched in a way that indicates an agent class. In that case an Instrumentation instance is passed to the premain method of the agent class.
  2. When a JVM provides a mechanism to start agents sometime after the JVM is launched. In that case an Instrumentation instance is passed to the agentmain method of the agent code.
ClassDescription
ClassDefinitionThis class serves as a parameter block to the Instrumentation.redefineClasses method. Serves to bind the Class that needs redefining together with the new class file bytes.
ExceptionDescription
IllegalClassFormatExceptionThrown by an implementation of ClassFileTransformer.transform when its input parameters are invalid. This may occur either because the initial class file bytes were invalid or a previously applied transform corrupted the bytes.
UnmodifiableClassException Thrown by an implementation of Instrumentation.redefineClasses when one of the specified classes cannot be modified.
Previous Home Next