public class ClassLoaderInfo extends Object implements Iterable<ClassInfo>, Comparable<ClassLoaderInfo>, Cloneable, Restorable<ClassLoaderInfo>
Modifier and Type | Field and Description |
---|---|
protected Map<String,Boolean> |
classAssertionStatus |
protected ClassInfo |
classInfo |
protected ClassPath |
cp |
protected boolean |
defaultAssertionStatus |
protected int |
id |
protected boolean |
isDefaultSet |
protected int |
objRef |
protected Map<String,Boolean> |
packageAssertionStatus |
protected ClassLoaderInfo |
parent |
protected Map<String,AnnotationInfo> |
resolvedAnnotations |
protected Map<String,ClassInfo> |
resolvedClasses |
protected boolean |
roundTripRequired |
protected Statics |
statics |
Modifier | Constructor and Description |
---|---|
protected |
ClassLoaderInfo(VM vm)
for use from SystemClassLoaderInfo ctor, which doesn't have a ClassLoader object
yet and has to set cp and id itself
|
protected |
ClassLoaderInfo(VM vm,
int objRef,
ClassPath cp,
ClassLoaderInfo parent)
for all other classloaders, which require an already instantiated ClassLoader object
|
Modifier and Type | Method and Description |
---|---|
protected void |
addResolvedClass(ClassInfo ci) |
void |
clearAssertionStatus() |
int |
compareTo(ClassLoaderInfo that)
Comparison for sorting based on index.
|
protected int |
computeId(int objRef) |
protected Statics |
createStatics(VM vm) |
protected boolean |
desiredAssertionStatus(String cname) |
String |
findResource(String resourceName)
Finds the first Resource in the classpath which has the specified name.
|
String[] |
findResources(String resourceName)
Finds all resources in the classpath with the given name.
|
protected ClassInfo |
getAlreadyResolvedClassInfo(String cname) |
static ClassFactory |
getClassFactory() |
ClassInfo |
getClassInfo()
Returns the type of the corresponding class loader object
|
ClassInfo |
getClassInfo(int id) |
int |
getClassLoaderObjectRef()
Returns the object reference.
|
ClassPath |
getClassPath() |
String[] |
getClassPathElements() |
static ClassLoaderInfo |
getCurrentClassLoader() |
static ClassLoaderInfo |
getCurrentClassLoader(ThreadInfo ti) |
static ClassInfo |
getCurrentResolvedClassInfo(String clsName) |
static SystemClassLoaderInfo |
getCurrentSystemClassLoader() |
protected ClassInfo |
getDefinedClassInfo(String typeName) |
ElementInfo |
getElementInfo(String typeName) |
int |
getId()
this is our internal, search global id that is used for the
canonical root set
|
ClassInfo |
getInitializedClassInfo(String clsName,
ThreadInfo ti)
this one is for clients that need to synchronously get an initialized classinfo.
|
protected ClassFileMatch |
getMatch(String typeName) |
Memento<ClassLoaderInfo> |
getMemento() |
Memento<ClassLoaderInfo> |
getMemento(MementoFactory factory) |
ElementInfo |
getModifiableElementInfo(String typeName) |
static int |
getNumberOfLoadedClasses() |
Map<String,ClassLoaderInfo> |
getPackages() |
AnnotationInfo |
getResolvedAnnotationInfo(String typeName) |
ClassInfo |
getResolvedAnnotationProxy(ClassInfo ciAnnotation) |
ClassInfo |
getResolvedClassInfo(String className)
obtain ClassInfo object for given class name
if the requested class or any of its superclasses and interfaces
is not found this method will throw a ClassInfoException.
|
ClassInfo |
getResolvedClassInfo(String className,
byte[] data,
int offset,
int length)
this is for user defined ClassLoaders that explicitly provide the class file data
|
protected String |
getResourceURL(String path,
String resource) |
Statics |
getStatics() |
static ClassInfo |
getSystemResolvedClassInfo(String clsName) |
protected boolean |
hasResolved(String cname) |
boolean |
isAlive()
For now, this always returns true, and it used while the classloader is being
serialized.
|
protected boolean |
isRoundTripRequired()
For optimizing the class loading mechanism, if the class loader class and the
classes of the whole parents hierarchy are descendant of URLClassLoader and
do not override the ClassLoader.loadClass() & URLClassLoader.findClass, resolving
the class is done natively within JPF
|
boolean |
isSystemClassLoader() |
Iterator<ClassInfo> |
iterator()
Returns an iterator over the classes that are defined (directly loaded) by this
classloader.
|
ClassInfo |
loadClass(String cname) |
protected ClassInfo |
loadClassOnJPF(String typeName) |
protected ClassInfo |
loadClassOnJVM(String cname) |
protected ClassInfo |
loadSystemClass(String clsName) |
protected void |
pushloadClassFrame(String typeName) |
void |
setClassAssertionStatus(String cname,
boolean enabled) |
void |
setDefaultAssertionStatus(boolean enabled) |
void |
setPackageAssertionStatus(String pname,
boolean enabled) |
ClassInfo |
tryGetResolvedClassInfo(String className)
obtain ClassInfo from context that does not care about resolution, i.e.
|
protected Map<String,AnnotationInfo> resolvedAnnotations
protected ClassPath cp
protected ClassInfo classInfo
protected Statics statics
protected boolean roundTripRequired
protected int id
protected int objRef
protected ClassLoaderInfo parent
protected boolean defaultAssertionStatus
protected boolean isDefaultSet
protected ClassLoaderInfo(VM vm)
protected ClassLoaderInfo(VM vm, int objRef, ClassPath cp, ClassLoaderInfo parent)
public static ClassFactory getClassFactory()
public static int getNumberOfLoadedClasses()
public Memento<ClassLoaderInfo> getMemento(MementoFactory factory)
getMemento
in interface Restorable<ClassLoaderInfo>
public Memento<ClassLoaderInfo> getMemento()
public int getId()
public ClassInfo getClassInfo()
public int getClassLoaderObjectRef()
protected int computeId(int objRef)
protected boolean isRoundTripRequired()
public boolean isSystemClassLoader()
public static ClassLoaderInfo getCurrentClassLoader()
public static ClassLoaderInfo getCurrentClassLoader(ThreadInfo ti)
public static SystemClassLoaderInfo getCurrentSystemClassLoader()
public ClassInfo getResolvedClassInfo(String className) throws ClassInfoException
ClassInfoException
public ClassInfo getResolvedClassInfo(String className, byte[] data, int offset, int length) throws ClassInfoException
ClassInfoException
public AnnotationInfo getResolvedAnnotationInfo(String typeName) throws ClassInfoException
ClassInfoException
protected void addResolvedClass(ClassInfo ci)
protected boolean hasResolved(String cname)
public ClassInfo getInitializedClassInfo(String clsName, ThreadInfo ti)
public ClassInfo tryGetResolvedClassInfo(String className)
className
- fully qualified classname to get a ClassInfo forpublic ClassInfo getClassInfo(int id)
protected void pushloadClassFrame(String typeName)
public ElementInfo getElementInfo(String typeName)
public ElementInfo getModifiableElementInfo(String typeName)
protected ClassFileMatch getMatch(String typeName)
public String findResource(String resourceName)
public String[] findResources(String resourceName)
public Statics getStatics()
public ClassPath getClassPath()
public String[] getClassPathElements()
public int compareTo(ClassLoaderInfo that)
compareTo
in interface Comparable<ClassLoaderInfo>
public Iterator<ClassInfo> iterator()
public boolean isAlive()
public Map<String,ClassLoaderInfo> getPackages()
protected boolean desiredAssertionStatus(String cname)
public void setDefaultAssertionStatus(boolean enabled)
public void setClassAssertionStatus(String cname, boolean enabled)
public void setPackageAssertionStatus(String pname, boolean enabled)
public void clearAssertionStatus()