|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.jboss.mx.loading.RepositoryClassLoader
public abstract class RepositoryClassLoader
A RepositoryClassLoader.
Field Summary | |
---|---|
protected EDU.oswego.cs.dl.util.concurrent.ReentrantLock |
loadLock
Lock |
protected ClassLoader |
parent
The parent classloader |
protected LoaderRepository |
repository
Reference to the repository. |
protected Exception |
unregisterTrace
The location where unregister is called from |
Constructor Summary | |
---|---|
protected |
RepositoryClassLoader(URL[] urls,
ClassLoader parent)
Create a new LoaderRepositoryClassLoader |
Method Summary | |
---|---|
protected void |
acquire()
Acquire the class loading lock. |
void |
addToClassBlackList(String name)
Black list a class |
void |
addToResourceBlackList(String name)
Black list a resource |
void |
addURL(URL url)
Append the given url to the URLs used for class and resource loading |
protected boolean |
attempt(long waitMS)
Attempt to acquire the class loading lock. |
void |
clearBlackLists()
Clear all blacklists |
void |
clearClassBlackList()
Clear any class black list. |
void |
clearResourceBlackList()
Clear any resource blacklist. |
protected void |
definePackage(String className)
Define the package for the class if not already done |
boolean |
equals(Object other)
This is here to document that this must delegate to the super implementation to perform identity based equality. |
protected Class |
findClass(String name)
Called by loadClassLocally to find the requested class within this class loaders class path. |
protected Class |
findClassLocally(String name)
Find the class |
Enumeration |
findResources(String name)
Find all resource URLs for the given name. |
Enumeration |
findResourcesLocally(String name)
Provides the same functionality as URLClassLoader.findResources(java.lang.String) . |
int |
getAddedOrder()
Get the order this classloader was added to the repository |
URL[] |
getAllURLs()
Return all library URLs associated with this RepositoryClassLoader |
URL[] |
getClasspath()
This method simply invokes the super.getURLs() method to access the list of URLs that make up the RepositoryClassLoader classpath. |
LoaderRepository |
getLoaderRepository()
Get the loader repository for this classloader |
abstract ObjectName |
getObjectName()
Get the ObjectName |
Package |
getPackage(String name)
|
Package[] |
getPackages()
|
protected ProtectionDomain |
getProtectionDomain(URL codesourceUrl)
Determine the protection domain. |
URL |
getResource(String name)
Attempts to load the resource from its URL and if not found forwards to the request to LoaderRepository . |
URL |
getResourceLocally(String name)
Provides the same functionality as ClassLoader.getResource(java.lang.String) . |
URL |
getURL()
Get the URL associated with the UCL. |
URL[] |
getURLs()
Return an empty URL array to force the RMI marshalling subsystem to use the java.server.codebase property as the annotated codebase. |
int |
hashCode()
This is here to document that this must delegate to the super implementation to perform identity based hashing. |
boolean |
isClassBlackListed(String name)
Is the class black listed? |
boolean |
isResourceBlackListed(String name)
Is the resource black listed? |
protected byte[] |
loadByteCode(String classname)
Obtain the bytecode for the indicated class from this class loaders classpath. |
protected byte[] |
loadByteCode(URL classURL)
Obtain the bytecode for the indicated class from this class loaders classpath. |
Class |
loadClass(String name,
boolean resolve)
The only caller of this method should be the VM initiated loadClassInternal() method. |
Class |
loadClassBefore(String name)
The only caller of this method should be the VM initiated loadClassInternal() method. |
Class |
loadClassImpl(String name,
boolean resolve,
int stopAt)
|
Class |
loadClassLocally(String name,
boolean resolve)
Called to attempt to load a class from the set of URLs associated with this classloader. |
protected void |
release()
Release the class loading lock previous acquired through the acquire method. |
void |
removeFromClassBlackList(String name)
Remove class from black list |
void |
removeFromResourceBlackList(String name)
Remove resource from black list |
void |
setAddedOrder(int addedOrder)
Set the order this classloader was added to the repository |
void |
setRepository(LoaderRepository repository)
Set the loader repository |
String |
toString()
Returns a string representation. |
void |
unregister()
|
Methods inherited from class java.net.URLClassLoader |
---|
definePackage, findResource, getPermissions, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LoaderRepository repository
protected Exception unregisterTrace
protected ClassLoader parent
protected EDU.oswego.cs.dl.util.concurrent.ReentrantLock loadLock
Constructor Detail |
---|
protected RepositoryClassLoader(URL[] urls, ClassLoader parent)
urls
- the urlsparent
- the parent classloaderMethod Detail |
---|
public abstract ObjectName getObjectName() throws MalformedObjectNameException
MalformedObjectNameException
public LoaderRepository getLoaderRepository()
public void setRepository(LoaderRepository repository)
repository
- the repositorypublic int getAddedOrder()
public void setAddedOrder(int addedOrder)
addedOrder
- the added orderpublic Class loadClassLocally(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
public URL getResourceLocally(String name)
ClassLoader.getResource(java.lang.String)
.
public URL getURL()
public void unregister()
public URL[] getClasspath()
public URL[] getAllURLs()
Do not remove this method without running the WebIntegrationTestSuite
public void addToClassBlackList(String name)
name
- the name of the classpublic void removeFromClassBlackList(String name)
name
- the name of the classpublic boolean isClassBlackListed(String name)
name
- the name of the class
public void clearClassBlackList()
public void addToResourceBlackList(String name)
name
- the name of the resourcepublic void removeFromResourceBlackList(String name)
name
- the name of the resourcepublic boolean isResourceBlackListed(String name)
name
- the name of the resource
public void clearResourceBlackList()
public void clearBlackLists()
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException
Forwards request to LoaderRepository
.
loadClass
in class ClassLoader
ClassNotFoundException
public Class loadClassBefore(String name) throws ClassNotFoundException
Forwards request to LoaderRepository
.
ClassNotFoundException
public Class loadClassImpl(String name, boolean resolve, int stopAt) throws ClassNotFoundException
ClassNotFoundException
public URL getResource(String name)
LoaderRepository
.
getResource
in class ClassLoader
public Enumeration findResources(String name) throws IOException
findResources
in class URLClassLoader
name
- the name of the resource
IOException
public Enumeration findResourcesLocally(String name) throws IOException
URLClassLoader.findResources(java.lang.String)
.
IOException
protected Class findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
name
- the name of the class
ClassNotFoundException
- if the class could not be foundprotected Class findClassLocally(String name) throws ClassNotFoundException
name
- the name of the class
ClassNotFoundException
protected void definePackage(String className)
className
- the class namepublic void addURL(URL url)
addURL
in class URLClassLoader
url
- the URL to load frompublic URL[] getURLs()
Do not remove this method without discussing it on the dev list.
getURLs
in class URLClassLoader
public Package getPackage(String name)
getPackage
in class ClassLoader
public Package[] getPackages()
getPackages
in class ClassLoader
public final boolean equals(Object other)
equals
in class Object
public final int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
protected boolean attempt(long waitMS)
loadClass(String, boolean)
protected void acquire()
loadClass(String, boolean)
protected void release()
protected byte[] loadByteCode(String classname) throws ClassNotFoundException, IOException
classname
-
ClassNotFoundException
- - if the class resource could not
be found
IOException
protected byte[] loadByteCode(URL classURL) throws ClassNotFoundException, IOException
classURL
-
ClassNotFoundException
- - if the class resource could not
be found
IOException
protected ProtectionDomain getProtectionDomain(URL codesourceUrl)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |