org.jboss.classloading.spi
Interface Translator


public interface Translator

An implementation of this interface in order to transform class files. The transformation occurs before the class is defined by the JVM.

Version:
$Revision:$
Author:
Scott.Stark@jboss.org
See Also:
ClassFileTransformer

Method Summary
 byte[] transform(DomainClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
          The implementation of this method may transform the supplied class file and return a new replacement class file.
 void unregisterClassLoader(DomainClassLoader loader)
          Called to indicate that the ClassLoader is being discarded by the server.
 

Method Detail

transform

byte[] transform(DomainClassLoader loader,
                 String className,
                 Class<?> classBeingRedefined,
                 ProtectionDomain protectionDomain,
                 byte[] classfileBuffer)
                 throws IllegalClassFormatException
The implementation of this method may transform the supplied class file and return a new replacement class file.

Parameters:
loader - - the DomainClassLoader owning the defining loader of the class to be transformed, may be null if the bootstrap loader
className - - the name of the class in the internal form of fully qualified class and interface names.
classBeingRedefined - - if this is a redefine, the class being redefined, otherwise null
protectionDomain - - the protection domain of the class being defined or redefined
classfileBuffer - - the input byte buffer in class file format - must not be modified
Returns:
a well-formed class file buffer (the result of the transform), or null if no transform is performed.
Throws:
IllegalClassFormatException - if the input does not represent a well-formed class file
See Also:
Instrumentation.redefineClasses(java.lang.instrument.ClassDefinition...)

unregisterClassLoader

void unregisterClassLoader(DomainClassLoader loader)
Called to indicate that the ClassLoader is being discarded by the server.

Parameters:
loader - - a class loader that has possibly been used previously as an argument to transform.


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.