| java.net.URLClassLoader org.quilt.cl.QuiltClassLoader
QuiltClassLoader | public class QuiltClassLoader extends URLClassLoader (Code) | | Quilt's transforming class loader. Can be directed to instrument
a set of classes, matching class names against a list of prefixes
and another list excluding classes from instrumentation, the
exclusion list taking priority. Will delegate loading to a parent
class loader where explicitly directed to; otherwise will be the
defining loader. By default the loading of classes whose names
begin with java., javax., junit., org.apache.bcel.,
org.apache.tools.ant. and org.quilt. is delegated.
Classes whose names begin with a reserved prefix, currently
test.data.Test, are synthesized instead of being
loaded. This must be specifically enabled.
author: Jim Dixon See Also: ClassFactory |
CLASSPATH_DELIM_CHAR | final public static char CLASSPATH_DELIM_CHAR(Code) | | |
CLASSPATH_DELIM_STR | final public static String CLASSPATH_DELIM_STR(Code) | | |
DELEGATED | final public static String[] DELEGATED(Code) | | Names of classes which must be loaded by the parent. There is one
exception to this list: org.quilt.QIC, which is not delegated and
not instrumented.
|
FILE_PATH_DELIM_CHAR | final public static char FILE_PATH_DELIM_CHAR(Code) | | Operating system specific
|
FILE_PATH_DELIM_STR | final public static String FILE_PATH_DELIM_STR(Code) | | |
SYNTH_PREFIX | final public static String SYNTH_PREFIX(Code) | | Prefix indicating that the class should be synthesized.
|
THIS_DIR | final public static String THIS_DIR(Code) | | Convert domain name in classpath to file name, allowing for
initial dots. Need to cope with ../../target/big.jar and
similar constructions.
|
THIS_DIR_LEN | final public static int THIS_DIR_LEN(Code) | | |
UP_DIR_LEN | final public static int UP_DIR_LEN(Code) | | |
cxf | List cxf(Code) | | Configurable class transformers.
|
gxf | List gxf(Code) | | Configurable graph transformers.
|
mxf | List mxf(Code) | | Configurable method transformers.
|
regMap | public Map regMap(Code) | | Map of registries by String name.
|
QuiltClassLoader | public QuiltClassLoader(URL[] cp, String[] inc)(Code) | | Constructor with abbreviated argument list.
|
QuiltClassLoader | public QuiltClassLoader(URL[] cp, ClassLoader parent, String[] del, String[] inc, String[] exc)(Code) | | Constructor with full argument list.
Parameters: cp - Class path, an array of paths Parameters: parent - Class loader which we delegate to. Parameters: del - String array, names of classes to be delegated Parameters: inc - String array, names of classes to be instrumented Parameters: exc - String array, names of classes not to be instrumented. |
addClassXformer | public void addClassXformer(ClassXformer xf)(Code) | | Add a class transformer.
|
addDelegated | public void addDelegated(String prefix)(Code) | | Add a class name prefix to the list of those to be delegated
to the parent.
Parameters: prefix - Prefix to be added. |
addExcluded | public void addExcluded(String prefix)(Code) | | Add a class name prefix to the list of those to be excluded
from instrumentation.
Parameters: prefix - Prefix to be added. |
addGraphXformer | public void addGraphXformer(GraphXformer xf)(Code) | | Add a graph transformer.
|
addIncluded | public void addIncluded(String prefix)(Code) | | Add a class name prefix to the list of those to be
instrumented.
Parameters: prefix - Prefix to be added. |
addPath | public void addPath(URL url)(Code) | | Add a path to the class loader's classpath.
Parameters: url - Path to be added. |
addQuiltRegistry | public QuiltRegistry addQuiltRegistry(String regName)(Code) | | Add a new QuiltRegistry to the list. An example of the
argument is "org.quilt.cover.stmt.StmtRegistry".
Parameters: regName - The domain name of the registry in dotted form. |
classFileName | public static String classFileName(String className)(Code) | | Convert a class name into a file name by replacing dots with
forward slashes and appending ".class".
|
cpToURLs | public static URL[] cpToURLs(String cp)(Code) | | Convert classpath in normal form to URL[]
|
domainToFileName | public static String domainToFileName(String name)(Code) | | Convert a dotted domain name to its path form, allowing for
leading ./ and ../ and terminating .jar
|
findClass | protected Class findClass(String name) throws ClassNotFoundException(Code) | | Locate the class whose name is passed and define it. If the
class name has the appropriate prefix and synthesizing it is
enabled, it synthesizes it. Otherwise it searches for it
along the class path. If indicated, it transforms (instruments)
the class. Finally, it defines and returns the result.
Parameters: name - Class name in embedded dot (.) form. |
getClassData | protected byte[] getClassData(String className) throws IOException(Code) | | Find a class along the class path and load it as a byte array.
|
getClassPath | public URL[] getClassPath()(Code) | | The classpath used by this QuiltClassLoader. |
getDelegated | public String[] getDelegated()(Code) | | As a String array the list of class name prefixeswhose loading is to be delegated to the parent. |
getExcluded | public String[] getExcluded()(Code) | | As a String array the list of class name prefixeswhich are NOT to be instrumented. |
getIncluded | public String[] getIncluded()(Code) | | As a String array the list of class name prefixeswhich ARE to be instrumented. |
getReport | public String getReport()(Code) | | Get reports from any or all registries. XXX This should not
be returning a String -- it might be huge.
|
getSynthEnabled | public boolean getSynthEnabled()(Code) | | Get synthesizing-enabled flag.
|
getSynthPrefix | public String getSynthPrefix()(Code) | | The prefix signifying that a class is to be synthesized. |
loadClass | public synchronized Class loadClass(String name) throws ClassNotFoundException(Code) | | Class loader. Delegates the loading if specifically instructed
to do so. Returns the class if it has already been loaded.
Otherwise creates a class transformer if necessary and then
passes the name to findClass.
|
setClassPath | public void setClassPath(String cp)(Code) | | Convert classpath in normal form to URL[] and sets loader
classpath to the corresponding value.
Parameters: cp - Class path in colon- or semicolon-delimited form. |
setExcluded | public void setExcluded(String s)(Code) | | Sets the list of classes to be excluded from instrumentation.
Parameters: s - List of classes in comma-separated String form. |
setIncluded | public void setIncluded(String s)(Code) | | Sets the list of classes to be instrumented.
Parameters: s - List of classes in comma-separated String form. |
setSynthEnabled | public void setSynthEnabled(boolean b)(Code) | | Enable class synthesizing.
|
urlsToString | public String urlsToString()(Code) | | Classpath as a newline-terminated String. |
|
|