com.caucho.loader.enhancer
Class EnhancerManager

java.lang.Object
  extended by com.caucho.loader.enhancer.EnhancerManager
All Implemented Interfaces:
java.lang.instrument.ClassFileTransformer

@Module
public class EnhancerManager
extends java.lang.Object
implements java.lang.instrument.ClassFileTransformer

Manages the enhancement


Method Summary
 void addClassEnhancer(ClassEnhancer classEnhancer)
          Adds a class enhancer.
static EnhancerManager create()
           
static EnhancerManager create(java.lang.ClassLoader loader)
           
 byte[] enhance(JClass jClass)
          Enhances the given class.
 JavaClassLoader getJavaClassLoader()
          Returns the JClassLoader.
static EnhancerManager getLocalEnhancer(java.lang.ClassLoader loader)
           
 Path getPostWorkPath()
          Gets the work path.
 Path getPreWorkPath()
          Gets the work path.
 Path getWorkPath()
          Gets the work path.
 boolean isClassMatch(java.lang.String className)
          Returns true for a matching class.
 void setWorkPath(Path workPath)
          Sets the work path.
 java.lang.String toString()
           
 byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> oldClass, java.security.ProtectionDomain domain, byte[] buffer)
          Returns the enhanced .class or null if no enhancement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static EnhancerManager create()

create

public static EnhancerManager create(java.lang.ClassLoader loader)

getLocalEnhancer

public static EnhancerManager getLocalEnhancer(java.lang.ClassLoader loader)

getJavaClassLoader

public JavaClassLoader getJavaClassLoader()
Returns the JClassLoader.


getWorkPath

public Path getWorkPath()
Gets the work path.


setWorkPath

public void setWorkPath(Path workPath)
Sets the work path.


getPreWorkPath

public final Path getPreWorkPath()
Gets the work path.


getPostWorkPath

public final Path getPostWorkPath()
Gets the work path.


addClassEnhancer

public void addClassEnhancer(ClassEnhancer classEnhancer)
Adds a class enhancer.


transform

public byte[] transform(java.lang.ClassLoader loader,
                        java.lang.String className,
                        java.lang.Class<?> oldClass,
                        java.security.ProtectionDomain domain,
                        byte[] buffer)
Returns the enhanced .class or null if no enhancement.

Specified by:
transform in interface java.lang.instrument.ClassFileTransformer

enhance

public byte[] enhance(JClass jClass)
               throws java.lang.ClassNotFoundException
Enhances the given class.

Throws:
java.lang.ClassNotFoundException

isClassMatch

public boolean isClassMatch(java.lang.String className)
Returns true for a matching class.


toString

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