edu.nyu.cs.pdsg.runtime
Class ContainerClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byjava.security.SecureClassLoader
          extended byjava.net.URLClassLoader
              extended byedu.nyu.cs.pdsg.runtime.ContainerClassLoader

public class ContainerClassLoader
extends java.net.URLClassLoader


Nested Class Summary
 
Nested classes inherited from class java.lang.ClassLoader
 
Field Summary
static int cclDebugLevel
           
(package private)  java.util.HashMap codebaseCache
           
(package private)  AuthorizationMonitor globalAuthMonitor
           
(package private)  PermissionsAdaptor globalPermissionsAdaptor
           
(package private)  long id
          This is the id which represents how many classes have been loaded by this current classloader class.
(package private)  long numClassesLoaded
           
(package private) static java.lang.Class permissionCollection
          Creates the permissions for the newly loaded class, and places them into a permission collection.
private static ContainerClassLoader self
           
private  SbRpcStack stack
           
(package private)  java.lang.String storedCodebase
           
static java.util.HashMap threadGroupMap
           
 
Fields inherited from class java.net.URLClassLoader
 
Fields inherited from class java.security.SecureClassLoader
 
Fields inherited from class java.lang.ClassLoader
 
Constructor Summary
(package private) ContainerClassLoader(java.net.URL[] urls)
           
 
Method Summary
private  void addToCache(java.lang.String codebase, java.lang.String name, java.lang.Class c)
           
protected  java.lang.Class findClass(java.lang.String name)
           
protected  java.lang.Class findClass(java.lang.String inCodebase, java.lang.String name)
           
private  java.lang.Class findInCache(java.lang.String codebase, java.lang.String name)
           
 java.lang.Class findLocally(java.lang.String codebase, java.lang.String name)
           
 byte[] getClassBytes(java.lang.String path, java.lang.String name)
           
 java.lang.String getCodebase()
           
private  java.security.CodeSource getCodeSource()
          Creates a new codesource based on the URL of class, and adds an ID based on how many classes have been loaded by this particular class loader on the local machine.
static ContainerClassLoader getInstance()
           
 java.security.PermissionCollection getPermissionCollection(java.lang.String name)
           
private  java.security.ProtectionDomain getProtectionDomain(java.lang.String className)
          Creates a protection domain for the newly loaded class which includes creating a codesource, and a permission collection.
 java.net.URL getResource(java.lang.String name)
           
 java.lang.Class loadClass(java.lang.String _name)
           
 java.lang.Class loadClass(java.lang.String _name, AuthorizationMonitor _authMonitor, PermissionsAdaptor _permissionsAdaptor)
           
 java.lang.Class loadClass(java.lang.String _codebase, java.lang.String _name)
           
 java.lang.Class loadClass(java.lang.String _codebase, java.lang.String _name, AuthorizationMonitor _authMonitor, PermissionsAdaptor _permissionsAdaptor)
           
private  byte[] loadClassData(java.lang.String _codebase, java.lang.String _name)
           
(package private)  void setAuthorizationMonitor(AuthorizationMonitor _authMonitor)
           
 void setCodebase(java.lang.String codebase)
           
(package private)  void setPermissionsAdaptor(PermissionsAdaptor _permissionsAdaptor)
           
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadGroupMap

public static java.util.HashMap threadGroupMap

self

private static final ContainerClassLoader self

stack

private SbRpcStack stack

storedCodebase

java.lang.String storedCodebase

codebaseCache

java.util.HashMap codebaseCache

cclDebugLevel

public static final int cclDebugLevel
See Also:
Constant Field Values

id

long id
This is the id which represents how many classes have been loaded by this current classloader class.


numClassesLoaded

long numClassesLoaded

globalAuthMonitor

AuthorizationMonitor globalAuthMonitor

globalPermissionsAdaptor

PermissionsAdaptor globalPermissionsAdaptor

permissionCollection

static java.lang.Class permissionCollection
Creates the permissions for the newly loaded class, and places them into a permission collection.

Constructor Detail

ContainerClassLoader

ContainerClassLoader(java.net.URL[] urls)
Method Detail

getInstance

public static ContainerClassLoader getInstance()

findLocally

public java.lang.Class findLocally(java.lang.String codebase,
                                   java.lang.String name)
                            throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

findInCache

private java.lang.Class findInCache(java.lang.String codebase,
                                    java.lang.String name)

addToCache

private void addToCache(java.lang.String codebase,
                        java.lang.String name,
                        java.lang.Class c)

findClass

protected java.lang.Class findClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

findClass

protected java.lang.Class findClass(java.lang.String inCodebase,
                                    java.lang.String name)
                             throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getClassBytes

public byte[] getClassBytes(java.lang.String path,
                            java.lang.String name)

loadClassData

private byte[] loadClassData(java.lang.String _codebase,
                             java.lang.String _name)

loadClass

public java.lang.Class loadClass(java.lang.String _name)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

loadClass

public java.lang.Class loadClass(java.lang.String _codebase,
                                 java.lang.String _name)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

loadClass

public java.lang.Class loadClass(java.lang.String _name,
                                 AuthorizationMonitor _authMonitor,
                                 PermissionsAdaptor _permissionsAdaptor)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

loadClass

public java.lang.Class loadClass(java.lang.String _codebase,
                                 java.lang.String _name,
                                 AuthorizationMonitor _authMonitor,
                                 PermissionsAdaptor _permissionsAdaptor)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getCodeSource

private java.security.CodeSource getCodeSource()
Creates a new codesource based on the URL of class, and adds an ID based on how many classes have been loaded by this particular class loader on the local machine.


setAuthorizationMonitor

void setAuthorizationMonitor(AuthorizationMonitor _authMonitor)

setPermissionsAdaptor

void setPermissionsAdaptor(PermissionsAdaptor _permissionsAdaptor)

getPermissionCollection

public java.security.PermissionCollection getPermissionCollection(java.lang.String name)

getProtectionDomain

private java.security.ProtectionDomain getProtectionDomain(java.lang.String className)
Creates a protection domain for the newly loaded class which includes creating a codesource, and a permission collection. This depends on the classes defined above.


setCodebase

public void setCodebase(java.lang.String codebase)

getCodebase

public java.lang.String getCodebase()

getResource

public java.net.URL getResource(java.lang.String name)


Copyright (c) 2002-2003 New York University RLAB