|
JBossMX Parent POM 6.0.0.GA | |||||||||
| 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 int |
loadClassDepth
A debugging variable used to track the recursive depth of loadClass() |
protected 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 |
clearBlackList(String name)
|
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<URL> |
findResources(String name)
Find all resource URLs for the given name. |
Enumeration<URL> |
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 |
Class<?> |
getCachedClass(String name)
|
URL |
getCachedResource(String name)
|
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)
|
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? |
boolean |
isValid()
|
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. |
abstract Class<?> |
loadClassImpl(String name,
boolean resolve,
int stopAt)
|
Class<?> |
loadClassLocally(String name,
boolean resolve)
|
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 ReentrantLock loadLock
protected int loadClassDepth
| Constructor Detail |
|---|
protected RepositoryClassLoader(URL[] urls,
ClassLoader parent)
urls - the urlsparent - the parent classloader| Method Detail |
|---|
public abstract ObjectName getObjectName()
getObjectName in interface org.jboss.classloading.spi.RealClassLoaderpublic boolean isValid()
isValid in interface org.jboss.classloading.spi.RealClassLoaderpublic LoaderRepository getLoaderRepository()
public void setRepository(LoaderRepository repository)
repository - the repositorypublic Class<?> getCachedClass(String name)
getCachedClass in interface org.jboss.classloading.spi.RealClassLoaderpublic URL getCachedResource(String name)
getCachedResource in interface org.jboss.classloading.spi.RealClassLoaderpublic void clearBlackList(String name)
clearBlackList in interface org.jboss.classloading.spi.RealClassLoaderpublic int getAddedOrder()
public void setAddedOrder(int addedOrder)
addedOrder - the added order
public Class<?> loadClassLocally(String name,
boolean resolve)
throws ClassNotFoundException
ClassNotFoundExceptionpublic URL getResourceLocally(String name)
getResourceLocally in interface org.jboss.util.loading.Translatablepublic 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 ClassLoaderClassNotFoundException
public Class<?> loadClassBefore(String name)
throws ClassNotFoundException
Forwards request to LoaderRepository.
name - the class name
ClassNotFoundException - when the class is not found
public abstract Class<?> loadClassImpl(String name,
boolean resolve,
int stopAt)
throws ClassNotFoundException
ClassNotFoundExceptionpublic URL getResource(String name)
LoaderRepository.
getResource in class ClassLoader
public Enumeration<URL> findResources(String name)
throws IOException
findResources in class URLClassLoadername - the name of the resource
IOException
public Enumeration<URL> findResourcesLocally(String name)
throws IOException
URLClassLoader.findResources(java.lang.String).
name - the resource name
IOException - for an error accessing the resources
protected Class<?> findClass(String name)
throws ClassNotFoundException
findClass in class URLClassLoadername - the name of the class
ClassNotFoundException - if the class could not be found
protected Class<?> findClassLocally(String name)
throws ClassNotFoundException
name - the name of the class
ClassNotFoundException - when the class is not foundprotected void definePackage(String className)
className - the class namepublic void addURL(URL url)
addURL in class URLClassLoaderurl - the URL to load frompublic URL[] getURLs()
Do not remove this method without discussing it on the dev list.
getURLs in class URLClassLoaderpublic Package getPackage(String name)
getPackage in class ClassLoaderpublic Package[] getPackages()
getPackages in class ClassLoaderpublic final boolean equals(Object other)
equals in class Objectpublic final int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectprotected boolean attempt(long waitMS)
waitMS - the length of time to wait in milliseconds
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 - when there is an error loading the class bytes
protected byte[] loadByteCode(URL classURL)
throws ClassNotFoundException,
IOException
classURL -
ClassNotFoundException - - if the class resource could not
be found
IOException - when there is an error loading the class bytesprotected ProtectionDomain getProtectionDomain(URL codesourceUrl)
codesourceUrl - the codesource url
|
JBossMX Parent POM 6.0.0.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||