|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.bytecode.buildtime.spi.AbstractInstrumenter
public abstract class AbstractInstrumenter
Provides the basic templating of how instrumentation should occur.
| Nested Class Summary | |
|---|---|
protected class |
AbstractInstrumenter.CustomFieldFilter
Allows control over what exactly to transform. |
| Nested classes/interfaces inherited from interface org.hibernate.bytecode.buildtime.spi.Instrumenter |
|---|
Instrumenter.Options |
| Field Summary | |
|---|---|
protected Logger |
logger
|
protected Instrumenter.Options |
options
|
| Constructor Summary | |
|---|---|
AbstractInstrumenter(Logger logger,
Instrumenter.Options options)
Creates the basic instrumentation strategy. |
|
| Method Summary | |
|---|---|
protected boolean |
checkMagic(File file,
long magic)
|
void |
execute(Set<File> files)
The main instrumentation entry point. |
protected abstract ClassDescriptor |
getClassDescriptor(byte[] byecode)
Given the bytecode of a java class, retrieve the descriptor for that class. |
protected abstract ClassTransformer |
getClassTransformer(ClassDescriptor descriptor,
Set classNames)
Create class transformer for the class. |
protected boolean |
isClassFile(File file)
Does this file represent a compiled class? |
protected boolean |
isJarFile(File file)
Does this file represent a zip file of some format? |
protected void |
processClassFile(File file,
Set<String> classNames)
Process a class file. |
protected void |
processFile(File file,
Set<String> classNames)
Actually process the file by applying instrumentation transformations to any classes it contains. |
protected void |
processJarFile(File file,
Set<String> classNames)
Process an archive file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Logger logger
protected final Instrumenter.Options options
| Constructor Detail |
|---|
public AbstractInstrumenter(Logger logger,
Instrumenter.Options options)
logger - The bridge to the environment's logging system.options - User-supplied options.| Method Detail |
|---|
protected abstract ClassDescriptor getClassDescriptor(byte[] byecode)
throws Exception
byecode - The class bytecode.
Exception - Indicates problems access the bytecode.
protected abstract ClassTransformer getClassTransformer(ClassDescriptor descriptor,
Set classNames)
descriptor - The descriptor of the class to be instrumented.classNames - The names of all classes to be instrumented; the "pipeline" if you will.
public void execute(Set<File> files)
execute in interface Instrumenterfiles - The files.
protected final boolean isClassFile(File file)
throws IOException
file - The file to check.
IOException - Indicates problem access the file.
protected final boolean isJarFile(File file)
throws IOException
file - The file to check.
IOException - Indicates problem access the file.
protected final boolean checkMagic(File file,
long magic)
throws IOException
IOException
protected void processFile(File file,
Set<String> classNames)
throws Exception
collectClassNames(java.io.File, java.util.Set) this method can handle both class and archive files.
file - The file to process.classNames - The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform extended instrumentation.
Exception - Indicates an issue either access files or applying the transformations.
protected void processClassFile(File file,
Set<String> classNames)
throws Exception
processFile(java.io.File, java.util.Set) in the case of a class file.
file - The class file to process.classNames - The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform extended instrumentation.
Exception - Indicates an issue either access files or applying the transformations.
protected void processJarFile(File file,
Set<String> classNames)
throws Exception
processFile(java.io.File, java.util.Set) in the case of an archive file.
file - The archive file to process.classNames - The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform extended instrumentation.
Exception - Indicates an issue either access files or applying the transformations.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||