Known Direct Subclasses
CGLIBInstrumenter |
Strategy for performing build-time instrumentation of persistent classes in order to enable
field-level interception using CGLIB. |
JavassistInstrumenter |
Strategy for performing build-time instrumentation of persistent classes in order to enable
field-level interception using Javassist. |
|
Class Overview
Provides the basic templating of how instrumentation should occur.
Summary
Nested Classes |
class |
AbstractInstrumenter.CustomFieldFilter |
Allows control over what exacctly to transform. |
Public Methods |
void
|
execute(Set files)
The main instrumentation entry point.
|
Fields
Public Constructors
Creates the basic instrumentation strategy.
Parameters
logger
| The bridge to the environment's logging system. |
options
| User-supplied options.
|
Public Methods
public
void
execute
(Set files)
The main instrumentation entry point. Given a set of files, perform instrumentation on each discovered class
file.
Protected Methods
protected
final
boolean
checkMagic
(File file, long magic)
protected
abstract
ClassDescriptor
getClassDescriptor
(byte[] byecode)
Given the bytecode of a java class, retrieve the descriptor for that class.
Parameters
byecode
| The class bytecode. |
Throws
Exception
| Indicates problems access the bytecode.
|
Create class transformer for the class.
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).
protected
final
boolean
isClassFile
(File file)
Does this file represent a compiled class?
Returns
- True if the file is a class; false otherwise.
protected
final
boolean
isJarFile
(File file)
Does this file represent a zip file of some format?
Returns
- True if the file is n archive; false otherwise.
protected
void
processClassFile
(File file, Set classNames)
Parameters
file
| The class file to process. |
classNames
| The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform Options#performExtendedInstrumentation() extended instrumentation. |
Throws
Exception
| Indicates an issue either access files or applying the transformations.
|
protected
void
processFile
(File file, Set classNames)
Actually process the file by applying instrumentation transformations to any classes it contains.
Again, just like with #collectClassNames this method can handle both class and archive files.
Parameters
file
| The file to process. |
classNames
| The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform Options#performExtendedInstrumentation() extended instrumentation. |
Throws
Exception
| Indicates an issue either access files or applying the transformations.
|
protected
void
processJarFile
(File file, Set classNames)
Parameters
file
| The archive file to process. |
classNames
| The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform Options#performExtendedInstrumentation() extended instrumentation. |
Throws
Exception
| Indicates an issue either access files or applying the transformations.
|