org.hibernate.bytecode.buildtime
Class JavassistInstrumenter

java.lang.Object
  extended by org.hibernate.bytecode.buildtime.AbstractInstrumenter
      extended by org.hibernate.bytecode.buildtime.JavassistInstrumenter
All Implemented Interfaces:
Instrumenter

public class JavassistInstrumenter
extends AbstractInstrumenter

Strategy for performing build-time instrumentation of persistent classes in order to enable field-level interception using Javassist.

Author:
Steve Ebersole, Muga Nishizawa

Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.bytecode.buildtime.AbstractInstrumenter
AbstractInstrumenter.CustomFieldFilter
 
Nested classes/interfaces inherited from interface org.hibernate.bytecode.buildtime.Instrumenter
Instrumenter.Options
 
Field Summary
 
Fields inherited from class org.hibernate.bytecode.buildtime.AbstractInstrumenter
logger, options
 
Constructor Summary
JavassistInstrumenter(Logger logger, Instrumenter.Options options)
           
 
Method Summary
protected  ClassDescriptor getClassDescriptor(byte[] bytecode)
          Given the bytecode of a java class, retrieve the descriptor for that class.
protected  ClassTransformer getClassTransformer(ClassDescriptor descriptor, Set classNames)
          Create class transformer for the class.
 
Methods inherited from class org.hibernate.bytecode.buildtime.AbstractInstrumenter
checkMagic, execute, isClassFile, isJarFile, processClassFile, processFile, processJarFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavassistInstrumenter

public JavassistInstrumenter(Logger logger,
                             Instrumenter.Options options)
Method Detail

getClassDescriptor

protected ClassDescriptor getClassDescriptor(byte[] bytecode)
                                      throws IOException
Description copied from class: AbstractInstrumenter
Given the bytecode of a java class, retrieve the descriptor for that class.

Specified by:
getClassDescriptor in class AbstractInstrumenter
Parameters:
bytecode - The class bytecode.
Returns:
The class's descriptor
Throws:
IOException

getClassTransformer

protected ClassTransformer getClassTransformer(ClassDescriptor descriptor,
                                               Set classNames)
Description copied from class: AbstractInstrumenter
Create class transformer for the class.

Specified by:
getClassTransformer in class AbstractInstrumenter
Parameters:
descriptor - The descriptor of the class to be instrumented.
classNames - The names of all classes to be instrumented; the "pipeline" if you will.
Returns:
The transformer for the given class; may return null to indicate that transformation should be skipped (ala already instrumented).


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