ClassFileTransformer


ClassFileTransformer java.lang.instrument

Java 5.0

A ClassFileTransformer registered through an Instrumentation object is offered a chance to transform every class that is subsequently loaded or redefined. The final argument to transform( ) is a byte array that contains the raw bytes of the class file (or bytes returned by a previously invoked ClassFileTransformer ). If the TRansform( ) method wishes to transform the class, it should return the transformed bytes in a newly allocated array. The array passed to transform( ) should not be modified. If the transform( ) method does not wish to transform a given class, it should return null .

 public interface  ClassFileTransformer  {  // Public Instance Methods  byte[ ]  transform  (ClassLoader  loader  , String  className  , Class<?>  classBeingRedefined  ,  java.security.ProtectionDomain  protectionDomain  , byte[ ]  classfileBuffer  )  throws IllegalClassFormatException;   } 

Passed To

Instrumentation.{addTransformer( ) , removeTransformer( )}



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net