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

public Class CGLIBInstrumenter

extends AbstractInstrumenter
Class Inheritance
Imports
java.util.Set, java.io.ByteArrayInputStream, org.hibernate.bytecode.util.ClassDescriptor, .BasicClassFilter, org.hibernate.bytecode.ClassTransformer, org.hibernate.bytecode.cglib.BytecodeProviderImpl, org.objectweb.asm.ClassReader, net.sf.cglib.core.ClassNameReader, net.sf.cglib.transform.impl.InterceptFieldEnabled

Strategy for performing build-time instrumentation of persistent classes in order to enable field-level interception using CGLIB.
Authors
Steve Ebersole, Gavin King

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
provider

Deprecated as a consequence of BytecodeProviderImpl being deprecated.
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.
byecode
)

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

Deprecated

as a consequence of BytecodeProviderImpl being deprecated. See corresponding docs for further information.

Constructor Detail

CGLIBInstrumenterback to summary
public CGLIBInstrumenter(Logger logger, Instrumenter.Options options)

Method Detail

getClassDescriptorback to summary
protected ClassDescriptor getClassDescriptor(byte[] byecode) throws Exception

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
byecode:byte[]

The class bytecode.

Returns:ClassDescriptor

The class's descriptor

Exceptions
Exception:
Indicates problems access the bytecode.
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 CGLIBInstrumenter.CustomClassDescriptor

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

Field Summary

Modifier and TypeField and Description
private final byte[]
private final boolean
private final String

Constructor Summary

AccessConstructor and Description
public
CustomClassDescriptor(byte[] bytecode)

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

bytecodeback to summary
private final byte[] bytecode
isInstrumentedback to summary
private final boolean isInstrumented
nameback to summary
private final String name

Constructor Detail

CustomClassDescriptorback to summary
public CustomClassDescriptor(byte[] bytecode) throws Exception

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.