FileDocCategorySizeDatePackage
InstrumentTask.javaAPI DocHibernate 3.2.53059Thu Aug 03 15:35:26 BST 2006org.hibernate.tool.instrument.javassist

InstrumentTask

public class InstrumentTask extends org.hibernate.tool.instrument.BasicInstrumentationTask
An Ant task for instrumenting persistent classes in order to enable field-level interception using Javassist.

In order to use this task, typically you would define a a taskdef similiar to:




where lib.class.path is an ANT path reference containing all the required Hibernate and Javassist libraries.

And then use it like:




...


where the nested ANT fileset includes the class you would like to have instrumented.

Optionally you can chose to enable "Extended Instrumentation" if desired by specifying the extended attriubute on the task:


...

See the Hibernate manual regarding this option.
author
Muga Nishizawa
author
Steve Ebersole

Fields Summary
private static final org.hibernate.bytecode.util.BasicClassFilter
CLASS_FILTER
private final org.hibernate.bytecode.javassist.BytecodeProviderImpl
provider
Constructors Summary
Methods Summary
protected org.hibernate.bytecode.util.ClassDescriptorgetClassDescriptor(byte[] bytecode)


	      
		return new CustomClassDescriptor( bytecode );
	
protected org.hibernate.bytecode.ClassTransformergetClassTransformer(org.hibernate.bytecode.util.ClassDescriptor descriptor)

		if ( descriptor.isInstrumented() ) {
			logger.verbose( "class [" + descriptor.getName() + "] already instrumented" );
			return null;
		}
		else {
			return provider.getTransformer( CLASS_FILTER, new CustomFieldFilter( descriptor ) );
		}