org.shiftone.jrat.inject.bytecode
Class Transformer

java.lang.Object
  extended by org.shiftone.jrat.inject.bytecode.Transformer
All Implemented Interfaces:
ShutdownListener, TransformerMBean

public class Transformer
extends java.lang.Object
implements ShutdownListener, TransformerMBean

This class is the application's interface to the bytecode injection package. Application code should not use the InjectorStrategy classes directly.

Node: setting the system property jrat.transformer.strategy will change the InjectorStrategy. Avalible options are bcel and javassist

Author:
jeff@shiftone.org (Jeff Drost)

Constructor Summary
Transformer()
           
Transformer(InjectorStrategy injectorStrategy)
           
 
Method Summary
 double getAverageBloatPercent()
           
 double getAverageTransformTimeMs()
           
 java.lang.String getInjectorStrategyText()
           
 long getTransformedClassCount()
           
 byte[] inject(byte[] input, java.lang.String sourceName, TransformerOptions options)
           
 byte[] inject(byte[] inputClassData, TransformerOptions options)
           
 byte[] inject(java.io.InputStream inputClassData, java.lang.String sourceName, TransformerOptions options)
           
 byte[] inject(java.io.InputStream inputClassData, TransformerOptions options)
           
 void shutdown()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transformer

public Transformer(InjectorStrategy injectorStrategy)

Transformer

public Transformer()
Method Detail

inject

public byte[] inject(byte[] inputClassData,
                     TransformerOptions options)

inject

public byte[] inject(java.io.InputStream inputClassData,
                     TransformerOptions options)

inject

public byte[] inject(byte[] input,
                     java.lang.String sourceName,
                     TransformerOptions options)

getTransformedClassCount

public long getTransformedClassCount()
Specified by:
getTransformedClassCount in interface TransformerMBean

getAverageTransformTimeMs

public double getAverageTransformTimeMs()
Specified by:
getAverageTransformTimeMs in interface TransformerMBean

getAverageBloatPercent

public double getAverageBloatPercent()
Specified by:
getAverageBloatPercent in interface TransformerMBean

getInjectorStrategyText

public java.lang.String getInjectorStrategyText()
Specified by:
getInjectorStrategyText in interface TransformerMBean

inject

public byte[] inject(java.io.InputStream inputClassData,
                     java.lang.String sourceName,
                     TransformerOptions options)

shutdown

public void shutdown()
Specified by:
shutdown in interface ShutdownListener

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object