Top Description Fields Constructors Methods
org.jboss.modules

public final Class JLIClassTransformer

extends Object
implements ClassTransformer
Class Inheritance
All Implemented Interfaces
org.jboss.modules.ClassTransformer
Imports
java.lang.instrument.ClassFileTransformer, .IllegalClassFormatException, java.nio.ByteBuffer, java.security.ProtectionDomain

A wrapper around a ClassFileTransformer.

Field Summary

Modifier and TypeField and Description
private final ClassFileTransformer

Constructor Summary

AccessConstructor and Description
public
JLIClassTransformer(final ClassFileTransformer
the delegate transformer (must not be null)
transformer
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
transform(final ClassLoader
the class loader of the class being transformed
loader
,
final String
the internal name of the class being transformed (not null)
className
,
final ProtectionDomain
the protection domain of the class, if any
protectionDomain
,
final ByteBuffer
the class bytes being transformed (not null; may be a direct or heap buffer)
classBytes
)

Implements org.jboss.modules.ClassTransformer.transform.

Transform the bytes of a class.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transformerback to summary
private final ClassFileTransformer transformer

Constructor Detail

JLIClassTransformerback to summary
public JLIClassTransformer(final ClassFileTransformer transformer)

Construct a new instance.

Parameters
transformer:ClassFileTransformer

the delegate transformer (must not be null)

Method Detail

transformback to summary
public ByteBuffer transform(final ClassLoader loader, final String className, final ProtectionDomain protectionDomain, final ByteBuffer classBytes) throws IllegalArgumentException

Implements org.jboss.modules.ClassTransformer.transform.

Doc from org.jboss.modules.ClassTransformer.transform.

Transform the bytes of a class. The position and limit of both the passed-in and returned buffers must mark the start and end of the class bytes.

Parameters
loader:ClassLoader

the class loader of the class being transformed

className:String

the internal name of the class being transformed (not null)

protectionDomain:ProtectionDomain

the protection domain of the class, if any

classBytes:ByteBuffer

the class bytes being transformed (not null; may be a direct or heap buffer)

Returns:ByteBuffer

the transformation result (may be a direct or heap buffer)

Exceptions
IllegalArgumentException:
if the class could not be transformed for some reason