| Modifier and Type | Class and Description |
|---|---|
| protected class | AbstractInstrumenter.CustomFieldFilter
Allows control over what exacctly to transform. |
| private static interface | AbstractInstrumenter.ZipEntryHandler
General strategy contract for handling entries in an archive file. |
| private static class | AbstractInstrumenter.ZipFileProcessor
Applies |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| protected final Logger | |
| protected final Instrumenter. | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | AbstractInstrumenter(Logger
The bridge to the environment's logging system. logger, Instrumenter.User-supplied options. optionsCreates the basic instrumentation strategy. |
| Modifier and Type | Method and Description |
|---|---|
| protected final boolean | |
| private void | collectClassNames(File
The file from which to extract class metadata (descriptor). file, final Set<E> The collected class name collection. classNames)Extract the names of classes from file, adding them to the classNames collection. |
| public void | execute(Set<E>
The files. files)Implements org. |
| protected abstract ClassDescriptor | Returns: The class's descriptorThe class bytecode. byecode)Given the bytecode of a java class, retrieve the descriptor for that class. |
| protected abstract ClassTransformer | Returns: The transformer for the given class; may return null to indicate that transformation should be skipped (ala already instrumented).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)Create class transformer for the class. |
| protected final boolean | Returns: True if the file is a class; false otherwise.The file to check. file)Does this file represent a compiled class? |
| protected final boolean | |
| protected void | processClassFile(File
The class file to process. file, Set<E> The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform classNames)extended instrumentation.Process a class file. |
| protected void | processFile(File
The file to process. file, Set<E> The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform classNames)extended instrumentation.Actually process the file by applying instrumentation transformations to any classes it contains. |
| protected void | processJarFile(final File
The archive file to process. file, final Set<E> The 'pipeline' of classes to be processed. Only actually populated when the user
specifies to perform classNames)extended instrumentation.Process an archive file. |
| CLASS_MAGIC | back to summary |
|---|---|
| private static final int CLASS_MAGIC | |
| logger | back to summary |
|---|---|
| protected final Logger logger | |
| options | back to summary |
|---|---|
| protected final Instrumenter. | |
| ZIP_MAGIC | back to summary |
|---|---|
| private static final int ZIP_MAGIC | |
| AbstractInstrumenter | back to summary |
|---|---|
| public AbstractInstrumenter(Logger logger, Instrumenter. Creates the basic instrumentation strategy.
| |
| checkMagic | back to summary |
|---|---|
| protected final boolean checkMagic(File file, long magic) throws IOException | |
| collectClassNames | back to summary |
|---|---|
| private void collectClassNames(File file, final Set<E> classNames) throws Exception Extract the names of classes from file, adding them to the classNames collection. IMPL NOTE : file here may be either a class file or a jar. If a jar, all entries in the jar file are processed. | |
| execute | back to summary |
|---|---|
| public void execute(Set<E> files) Implements org. The main instrumentation entry point. Given a set of files, perform instrumentation on each discovered class file.
| |
| getClassDescriptor | back to summary |
|---|---|
| protected abstract ClassDescriptor getClassDescriptor(byte[] byecode) throws Exception Given the bytecode of a java class, retrieve the descriptor for that class.
| |
| getClassTransformer | back to summary |
|---|---|
| protected abstract ClassTransformer getClassTransformer(ClassDescriptor descriptor, Set<E> classNames) Create class transformer for the class.
| |
| isClassFile | back to summary |
|---|---|
| protected final boolean isClassFile(File file) throws IOException Does this file represent a compiled class?
| |
| isJarFile | back to summary |
|---|---|
| protected final boolean isJarFile(File file) throws IOException Does this file represent a zip file of some format?
| |
| processClassFile | back to summary |
|---|---|
| protected void processClassFile(File file, Set<E> classNames) throws Exception Process a class file. Delegated to from | |
| processFile | back to summary |
|---|---|
| protected void processFile(File file, Set<E> classNames) throws Exception Actually process the file by applying instrumentation transformations to any classes it contains.
Again, just like with | |
| processJarFile | back to summary |
|---|---|
| protected void processJarFile(final File file, final Set<E> classNames) throws Exception Process an archive file. Delegated to from | |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final ClassDescriptor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | shouldInstrumentField(String
The name of the class currently being processed className, String The name of the field being checked. fieldName)Implements org. |
| public boolean | shouldTransformFieldAccess(String
The class currently being transformed. transformingClassName, String The name of the class owning this field being checked. fieldOwnerClassName, String The name of the field being checked. fieldName)Implements org. |
| classNames | back to summary |
|---|---|
| private final Set<E> classNames | |
| descriptor | back to summary |
|---|---|
| private final ClassDescriptor descriptor | |
| CustomFieldFilter | back to summary |
|---|---|
| public CustomFieldFilter(ClassDescriptor descriptor, Set<E> classNames) | |
| shouldInstrumentField | back to summary |
|---|---|
| public boolean shouldInstrumentField(String className, String fieldName) Implements org. Doc from org. Should this field definition be instrumented? | |
| shouldTransformFieldAccess | back to summary |
|---|---|
| public boolean shouldTransformFieldAccess(String transformingClassName, String fieldOwnerClassName, String fieldName) Implements org. Doc from org. Should we instrument *access to* the given field. This differs from
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | handleEntry(ZipEntry
The archive file entry. entry, byte[] byteCode)Apply strategy to the given archive entry. |
| handleEntry | back to summary |
|---|---|
| public void handleEntry(ZipEntry entry, byte[] byteCode) throws Exception Apply strategy to the given archive entry.
| |
ZipEntryHandler strategies to the entries of an archive file.
| Modifier and Type | Field and Description |
|---|---|
| private final AbstractInstrumenter. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| entryHandler | back to summary |
|---|---|
| private final AbstractInstrumenter. | |
| ZipFileProcessor | back to summary |
|---|---|
| public ZipFileProcessor(AbstractInstrumenter. | |
| process | back to summary |
|---|---|
| public void process(File file) throws Exception | |