|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.ClassLoader
com.ibm.aglets.tahiti.AgletClassLoader
Class AgletClassLoader is responsible for loading classes for the aglets. This class has a class loader cache as a static member and store all class loader objects with keys which is the URL of the origin of classes managed by the loader. In aglets bytecodes of classes are transfered with objects. Therefore, there may be many version of classes whose names are same in an aglet server. In aglets classes are managed based on their origin. Classes which sources of their bytecodes are same are managed by a same aglet loader in an aglet server. Therefore, an object can access objects if sources of their class bytecodes are same, otherwise ClassCastException will occur.
An aglet loader caches classes and their bytecodes.
| Nested Class Summary |
| Nested classes inherited from class java.lang.ClassLoader |
|
| Field Summary | |
(package private) static AgentProfile |
_agent_profile
|
protected static CacheManager |
_cache
Cache to store bytecodes of classes. |
private java.net.URL |
_codeBase
|
protected DigestTable |
_digest_table
Digest table for classes managed by this classloader. |
private java.security.cert.Certificate |
_ownerCert
|
private java.util.Hashtable |
_resolvedClassCache
Cache to store resolved classes. |
private java.util.Vector |
_resources
|
private static LogCategory |
log
|
| Fields inherited from class java.lang.ClassLoader |
|
| Constructor Summary | |
protected |
AgletClassLoader(java.net.URL codebase,
java.security.cert.Certificate owner)
Constructs a new AgletClassLoader with codebase. |
| Method Summary | |
void |
addResource(java.lang.Object o)
Adds a feature to the Resource attribute of the AgletClassLoader object |
void |
cacheResolvedClass(java.lang.Class cls)
Description of the Method |
boolean |
contains(java.lang.Class cls)
Checks if the given class is managed by this manager. |
void |
disposeAllResources()
Description of the Method |
private static void |
dumpBytes(byte[] bytes)
Description of the Method |
void |
finalize()
Shout when an AgletClassLoader object is caught by GC. |
private byte[] |
findByteCode(java.lang.String classname)
Description of the Method |
protected byte[] |
findByteCodeInCache(java.lang.String filename)
Description of the Method |
private java.lang.Class |
findClassInternal(java.lang.String name)
Loads a class |
private java.lang.Class |
findResolvedClass(java.lang.String classname)
Gets the class specified by the name from resolved cache. |
Archive |
getArchive(ClassName[] t)
Gets the archive attribute of the AgletClassLoader object |
ClassName[] |
getClassNames(java.lang.Class[] classes)
Computes Digest |
java.net.URL |
getCodeBase()
Tells where the class was loaded from. |
java.security.cert.Certificate |
getOwnerCertificate()
Gets certificate of the owner. |
protected byte[] |
getResourceAsByteArray(java.lang.String filename)
Gets the resourceAsByteArray attribute of the AgletClassLoader object |
java.io.InputStream |
getResourceAsStream(java.lang.String filename)
Gets the resourceAsStream attribute of the AgletClassLoader object |
void |
importArchive(Archive a)
Description of method. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Loads a class specified by the param name. |
private java.lang.Class |
loadClassFromCodeBase(java.lang.String classname)
Description of the Method |
private byte[] |
loadResourceFromCodeBase(java.lang.String name)
The method for loading class data. |
boolean |
match(ClassName[] table)
Description of the Method |
boolean |
matchAndImport(ClassName[] table)
Description of the Method |
AgletThread |
newAgletThread(MessageManager mm)
Description of the Method |
private void |
putResource(java.lang.String name,
byte[] data)
Description of the Method |
private void |
releaseCacheEntries()
Description of the Method |
void |
resumeAllThreads()
Description of the Method |
void |
setResourceManagerContext()
Sets the resourceManagerContext attribute of the AgletClassLoader object |
void |
stopAllThreads()
Description of the Method |
void |
stopThreadGroup()
Description of the Method |
void |
suspendAllThreads()
Description of the Method |
java.lang.String |
toString()
Description of the Method |
void |
unsetResourceManagerContext()
Description of the Method |
private static void |
verboseOut(java.lang.String msg)
Description of the Method |
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ibm.aglets.ResourceManager |
loadClass |
| Field Detail |
protected static CacheManager _cache
static AgentProfile _agent_profile
private static final LogCategory log
protected DigestTable _digest_table
private java.net.URL _codeBase
private java.security.cert.Certificate _ownerCert
private java.util.Hashtable _resolvedClassCache
private java.util.Vector _resources
| Constructor Detail |
protected AgletClassLoader(java.net.URL codebase,
java.security.cert.Certificate owner)
codebase - the codebase in which the all classes are originated.owner - Certificate of the owner| Method Detail |
private static void dumpBytes(byte[] bytes)
bytes - Description of Parameterprivate static void verboseOut(java.lang.String msg)
msg - Description of Parameterpublic void setResourceManagerContext()
setResourceManagerContext in interface ResourceManagerpublic Archive getArchive(ClassName[] t)
getArchive in interface ResourceManagert - Description of Parameter
public ClassName[] getClassNames(java.lang.Class[] classes)
getClassNames in interface ResourceManagerclasses - Description of Parameter
public java.net.URL getCodeBase()
public java.security.cert.Certificate getOwnerCertificate()
public java.io.InputStream getResourceAsStream(java.lang.String filename)
filename - Description of Parameter
public void addResource(java.lang.Object o)
addResource in interface ResourceManagero - The feature to be added to the Resource attributepublic void cacheResolvedClass(java.lang.Class cls)
cls - Description of Parameterpublic boolean contains(java.lang.Class cls)
contains in interface ResourceManagercls - Description of Parameter
public void disposeAllResources()
disposeAllResources in interface ResourceManagerpublic void finalize()
public void importArchive(Archive a)
importArchive in interface ResourceManagera - Description of Parameterpublic boolean match(ClassName[] table)
table - Description of Parameter
public boolean matchAndImport(ClassName[] table)
table - Description of Parameter
public AgletThread newAgletThread(MessageManager mm)
newAgletThread in interface ResourceManagermm - Description of Parameter
public void resumeAllThreads()
resumeAllThreads in interface ResourceManagerpublic void stopAllThreads()
stopAllThreads in interface ResourceManagerpublic void stopThreadGroup()
stopThreadGroup in interface ResourceManagerpublic void suspendAllThreads()
suspendAllThreads in interface ResourceManagerpublic java.lang.String toString()
public void unsetResourceManagerContext()
unsetResourceManagerContext in interface ResourceManagerprotected byte[] getResourceAsByteArray(java.lang.String filename)
filename - Description of Parameter
protected byte[] findByteCodeInCache(java.lang.String filename)
filename - Description of Parameter
protected java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
name - the name of the desired class.resolve - true if the class must be resolved.
java.lang.ClassNotFoundException - if the class is not found.private byte[] findByteCode(java.lang.String classname)
classname - Description of Parameter
private java.lang.Class findClassInternal(java.lang.String name)
throws java.lang.ClassNotFoundException
name - Description of Parameter
java.lang.ClassNotFoundException - Description of ExceptionloadClass(java.lang.String, boolean),
AgletClassLoader#instantiageAgletprivate java.lang.Class findResolvedClass(java.lang.String classname)
classname - Description of Parameter
private java.lang.Class loadClassFromCodeBase(java.lang.String classname)
throws java.lang.ClassNotFoundException
classname - Description of Parameter
java.lang.ClassNotFoundException - Description of Exceptionprivate byte[] loadResourceFromCodeBase(java.lang.String name)
name - the class name.
private void putResource(java.lang.String name,
byte[] data)
name - Description of Parameterdata - Description of Parameterprivate void releaseCacheEntries()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||