org.hibernate.bytecode
Class AbstractClassTransformerImpl

java.lang.Object
  extended by org.hibernate.bytecode.AbstractClassTransformerImpl
All Implemented Interfaces:
ClassTransformer
Direct Known Subclasses:
CglibClassTransformer, JavassistClassTransformer

public abstract class AbstractClassTransformerImpl
extends Object
implements ClassTransformer

Basic implementation of the ClassTransformer contract.

Author:
Emmanuel Bernard, Steve Ebersole

Field Summary
protected  ClassFilter classFilter
           
protected  FieldFilter fieldFilter
           
 
Constructor Summary
protected AbstractClassTransformerImpl(ClassFilter classFilter, FieldFilter fieldFilter)
           
 
Method Summary
protected abstract  byte[] doTransform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
           
 byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
          Invoked when a class is being loaded or redefined to add hooks for persistence bytecode manipulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classFilter

protected final ClassFilter classFilter

fieldFilter

protected final FieldFilter fieldFilter
Constructor Detail

AbstractClassTransformerImpl

protected AbstractClassTransformerImpl(ClassFilter classFilter,
                                       FieldFilter fieldFilter)
Method Detail

transform

public byte[] transform(ClassLoader loader,
                        String className,
                        Class classBeingRedefined,
                        ProtectionDomain protectionDomain,
                        byte[] classfileBuffer)
Description copied from interface: ClassTransformer
Invoked when a class is being loaded or redefined to add hooks for persistence bytecode manipulation

Specified by:
transform in interface ClassTransformer
Parameters:
loader - the defining class loaderof the class being transformed. It may be null if using bootstrap loader
className - The name of the class being transformed
classBeingRedefined - If an already loaded class is being redefined, then pass this as a parameter
protectionDomain - ProtectionDomain of the class being (re)-defined
classfileBuffer - The input byte buffer in class file format
Returns:
A well-formed class file that can be loaded

doTransform

protected abstract byte[] doTransform(ClassLoader loader,
                                      String className,
                                      Class classBeingRedefined,
                                      ProtectionDomain protectionDomain,
                                      byte[] classfileBuffer)


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.