Top Description Inners Fields Constructors Methods
org.hibernate.bytecode.buildtime

public Class JavassistInstrumenter

extends AbstractInstrumenter
Class Inheritance
Imports
java.util.Set, java.io.IOException, .DataInputStream, .ByteArrayInputStream, javassist.bytecode.ClassFile, org.hibernate.bytecode.util.ClassDescriptor, .BasicClassFilter, org.hibernate.bytecode.ClassTransformer, org.hibernate.bytecode.javassist.BytecodeProviderImpl, .FieldHandled

Strategy for performing build-time instrumentation of persistent classes in order to enable field-level interception using Javassist.
Authors
Steve Ebersole, Muga Nishizawa

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final BasicClassFilter
private final BytecodeProviderImpl
Inherited from org.hibernate.bytecode.buildtime.AbstractInstrumenter:
loggeroptions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ClassDescriptor
getClassDescriptor(byte[]
The class bytecode.
bytecode
)

Implements abstract org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassDescriptor.

Given the bytecode of a java class, retrieve the descriptor for that class.
protected ClassTransformer
getClassTransformer(ClassDescriptor
The descriptor of the class to be instrumented.
descriptor
,
Set<E>
The names of all classes to be instrumented; the "pipeline" if you will.
classNames
)

Implements abstract org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassTransformer.

Create class transformer for the class.
Inherited from org.hibernate.bytecode.buildtime.AbstractInstrumenter:
checkMagicexecuteisClassFileisJarFileprocessClassFileprocessFileprocessJarFile

Field Detail

CLASS_FILTERback to summary
private static final BasicClassFilter CLASS_FILTER
providerback to summary
private final BytecodeProviderImpl provider

Constructor Detail

JavassistInstrumenterback to summary
public JavassistInstrumenter(Logger logger, Instrumenter.Options options)

Method Detail

getClassDescriptorback to summary
protected ClassDescriptor getClassDescriptor(byte[] bytecode) throws IOException

Implements abstract org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassDescriptor.

Doc from org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassDescriptor.

Given the bytecode of a java class, retrieve the descriptor for that class.

Parameters
bytecode:byte[]

The class bytecode.

Returns:ClassDescriptor

The class's descriptor

getClassTransformerback to summary
protected ClassTransformer getClassTransformer(ClassDescriptor descriptor, Set<E> classNames)

Implements abstract org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassTransformer.

Doc from org.hibernate.bytecode.buildtime.AbstractInstrumenter.getClassTransformer.

Create class transformer for the class.

Parameters
descriptor:ClassDescriptor

The descriptor of the class to be instrumented.

classNames:Set<E>

The names of all classes to be instrumented; the "pipeline" if you will.

Returns:ClassTransformer

The transformer for the given class; may return null to indicate that transformation should be skipped (ala already instrumented).

org.hibernate.bytecode.buildtime back to summary

private Class JavassistInstrumenter.CustomClassDescriptor

extends Object
implements ClassDescriptor
Class Inheritance
  • java.lang.Object
  • org.hibernate.bytecode.buildtime.JavassistInstrumenter.CustomClassDescriptor
All Implemented Interfaces
org.hibernate.bytecode.util.ClassDescriptor

Field Summary

Modifier and TypeField and Description
private final byte[]
private final ClassFile

Constructor Summary

AccessConstructor and Description
public
CustomClassDescriptor(byte[] bytes)

Method Summary

Modifier and TypeMethod and Description
public byte[]
getBytes()

Implements org.hibernate.bytecode.util.ClassDescriptor.getBytes.

The bytes making up the class' bytecode.
public String
public boolean
isInstrumented()

Implements org.hibernate.bytecode.util.ClassDescriptor.isInstrumented.

Determine if the class is already instrumented.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
private final byte[] bytes
classFileback to summary
private final ClassFile classFile

Constructor Detail

CustomClassDescriptorback to summary
public CustomClassDescriptor(byte[] bytes) throws IOException

Method Detail

getBytesback to summary
public byte[] getBytes()

Implements org.hibernate.bytecode.util.ClassDescriptor.getBytes.

Doc from org.hibernate.bytecode.util.ClassDescriptor.getBytes.

The bytes making up the class' bytecode.

Returns:byte[]

The bytecode bytes.

getNameback to summary
public String getName()

Implements org.hibernate.bytecode.util.ClassDescriptor.getName.

Doc from org.hibernate.bytecode.util.ClassDescriptor.getName.

The name of the class.

Returns:String

The class name.

isInstrumentedback to summary
public boolean isInstrumented()

Implements org.hibernate.bytecode.util.ClassDescriptor.isInstrumented.

Doc from org.hibernate.bytecode.util.ClassDescriptor.isInstrumented.

Determine if the class is already instrumented.

Returns:boolean

True if already instrumented; false otherwise.