|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.util.resources.ClassLoaderCache
public class ClassLoaderCache
cache for class loaders used during pre-instrumentation or transformation
processes. The ACTF AOP engine uses the bootstrap classpath to perform .class
file transformations and entries on this classpath cannot simultaneously
occur on the standard classpath. Hence, any need for a Class
object fo the former set of classes must be retreaved via this class. This
cache should also be used to perform all class-comparison operations such as
instanceof
and isAssignableFrom
.
Constructor Summary | |
---|---|
protected |
ClassLoaderCache()
|
Method Summary | |
---|---|
Class |
classForName(String className)
get a java.lang.Class object representing the named class |
ClassLoader |
getClassLoaderFor(String className)
get the java.lang.ClassLoader reference for the named
class. |
static ClassLoaderCache |
getDefault()
get the default cache or create one if one has not already been created |
URL |
getResource(String name)
get a java.net.URL object representing the named resource |
Enumeration |
getResources(String name)
get a java.util.Enumeration representing the named resources |
boolean |
isAssignableFrom(String className,
Class testCls)
test whether or not the given class is assignable to the specified class name. |
boolean |
isInstanceOf(String className,
Object o)
test whether or not the specified object is an instance of the class with the given name. |
boolean |
isNonAdvisableClassName(String classname)
returns whether or not this class name names a class that cannot be instrumented in ACTF. |
void |
put(String className,
ClassLoader cl)
add a class name with its corresponding class loader to the cache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ClassLoaderCache()
Method Detail |
---|
public static ClassLoaderCache getDefault()
public URL getResource(String name)
java.net.URL
object representing the named resource
resourceName
- -
name of desired resource
java.net.URL
object or null
if
name cannot be resolvedpublic Enumeration getResources(String name) throws IOException
java.util.Enumeration
representing the named resources
resourceName
- -
name of desired resource
java.util.Enumeration
object or null
if
name cannot be resolved
IOException
public Class classForName(String className)
java.lang.Class
object representing the named class
className
- -
name of desired class
java.lang.Class
object or null
if
name cannot be resolvedpublic ClassLoader getClassLoaderFor(String className)
java.lang.ClassLoader
reference for the named
class. The algorithm used by this method is as follows:
Note: This method is used by all other methods in this class to resolve class names.
className
- name of class
ClassLoader
object for the class named or
null
if the name cannot be resolvedpublic void put(String className, ClassLoader cl)
className
- -
name of classcl
- -
class loaderpublic boolean isAssignableFrom(String className, Class testCls)
className
- name of class to which target is to be assignedtestCls
- class to be tested
true
if and only if the test class is equal to or
a subclass of the class name, false
otherwiseClass.isAssignableFrom(java.lang.Class)
public boolean isInstanceOf(String className, Object o)
className
- -
name of classo
- -
object to be tested
true
if and only if the object is an instance of
hte class named by the className, false
otherwisepublic boolean isNonAdvisableClassName(String classname)
classname
- name of class to be tested
true
if class named by this class name can be
instrumented, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |