|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.softevo.ample.instrument.AmpleInstrumenter
public class AmpleInstrumenter
This class contains contains the entry point for the instrumentation of bytecode.
Field Summary | |
---|---|
private java.io.File |
classDirectory
The directory that contains the classes that should be instrumented. |
private InstrumentationConfiguration |
config
Instrumentation configuration for instrumenter run. |
private org.softevo.sibrelib.classfilter.ClassFilter |
filter
The filter to be used. |
private java.util.HashSet |
instrumentClassNames
The set of class names that are instrumented. |
private org.eclipse.jdt.launching.IVMInstall |
vmInstall
The virtual machine used for running instrumented files. |
private java.io.File |
workingDirectory
The directory used as working directory by the virtual machine instance. |
Constructor Summary | |
---|---|
AmpleInstrumenter(InstrumentationConfiguration config,
java.io.File classDirectory,
java.io.File workingDirectory,
org.softevo.sibrelib.classfilter.ClassFilter filter,
org.eclipse.jdt.launching.IVMInstall vmInstall)
Creates a new instrumenter for a set of classes. |
Method Summary | |
---|---|
private java.util.HashSet |
getCoreClassSet()
Gets the set of core classes to be used by te instrumentation. |
java.util.HashSet |
getInstrumentClassNames()
|
private java.util.HashSet |
getInstrumentClassNames(org.softevo.sibrelib.source.ClassFileSource source)
Calculates the names of all classes that shall be instrumented. |
private java.util.Vector |
getTraceExtensions(org.softevo.sibrelib.InstrumentationContext context)
Determines which instrumentation extensions are needed by the given configuration. |
void |
instrument()
Instruments all files in the class file source. |
private java.util.HashSet |
readFromCache(java.io.File cacheFile)
This method tries to read the core class set from the cache. |
private void |
writeToCache(java.io.File cacheFile,
java.util.HashSet coreClassSet)
Saves a set of core classes into the cache directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private InstrumentationConfiguration config
private java.io.File workingDirectory
private java.io.File classDirectory
private org.softevo.sibrelib.classfilter.ClassFilter filter
private org.eclipse.jdt.launching.IVMInstall vmInstall
private java.util.HashSet instrumentClassNames
Constructor Detail |
---|
public AmpleInstrumenter(InstrumentationConfiguration config, java.io.File classDirectory, java.io.File workingDirectory, org.softevo.sibrelib.classfilter.ClassFilter filter, org.eclipse.jdt.launching.IVMInstall vmInstall)
config
- the instrumentation configurationclassDirectory
- the class directoryworkingDirectory
- the working directory of the virtual machinefilter
- a filter for classes that shouldn't be instrumentedvmInstall
- the virtual machineMethod Detail |
---|
private java.util.Vector getTraceExtensions(org.softevo.sibrelib.InstrumentationContext context)
context
- the instrumentation context
private java.util.HashSet getInstrumentClassNames(org.softevo.sibrelib.source.ClassFileSource source)
source
- the class file source
private void writeToCache(java.io.File cacheFile, java.util.HashSet coreClassSet) throws java.io.IOException
cacheFile
- the file the cached core class set should be stored incoreClassSet
- the class set to cache
java.io.IOException
- if an exception occurs writing the cache fileprivate java.util.HashSet readFromCache(java.io.File cacheFile) throws java.io.IOException, java.lang.ClassNotFoundException
cacheFile
- the file that is supposed to contain the cached values
null
if not found
java.io.IOException
- if an exception occurs reading from the cache
java.lang.ClassNotFoundException
private java.util.HashSet getCoreClassSet() throws org.softevo.sibrelib.InstrumentationException, java.io.IOException, java.lang.ClassNotFoundException
org.softevo.sibrelib.InstrumentationException
- if the runtime jar file was not found
java.io.IOException
- if an exception occurs reading from or writing to the cache
java.lang.ClassNotFoundException
public void instrument() throws java.io.IOException, org.softevo.sibrelib.InstrumentationException, java.lang.ClassNotFoundException
java.io.IOException
- if an exception occurs reading/writing cached results
org.softevo.sibrelib.InstrumentationException
- if the runtime jar file cannot be found
java.lang.ClassNotFoundException
public java.util.HashSet getInstrumentClassNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |