alt.jiapi.agent
Class Transformer

java.lang.Object
  extended by alt.jiapi.agent.Transformer
Direct Known Subclasses:
HotSpotTransformer

public class Transformer
extends java.lang.Object

This class is Jiapi equivalent of java.lang.instrument.ClassFileTransformer.


Constructor Summary
Transformer()
           
 
Method Summary
 void init(java.util.Properties p)
          Initialize Transformer with given properties.
 boolean retransform(JiapiClass clazz)
          Retransform given JiapiClass.
 boolean transform(JiapiClass clazz)
          Transform given JiapiClass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformer

public Transformer()
Method Detail

init

public void init(java.util.Properties p)
Initialize Transformer with given properties.


retransform

public boolean retransform(JiapiClass clazz)
Retransform given JiapiClass. This method should do whatever bytecode manipulation is needed. If no bytecode is modified, this method should return false. This signals agent, that bytecode has not changed.

Retransforming a class indicates, that a class has been loaded into JVM already. By modifying a class, a class reloading should occur in JVM.

Returns:
true, if bytecode has changed. Default is to return false.

transform

public boolean transform(JiapiClass clazz)
Transform given JiapiClass. This method should do whatever bytecode manipulation is needed. If no bytecode is modified, this method should return false. This signals agent, that bytecode has not changed.

This method is called for the class, if a class is being loaded into JVM for the first time.

Returns:
true, if bytecode has changed. Default is to return false.


Copyright © 2001. Documenation generated August 26 2011.