|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.classloader.spi.base.BaseClassLoaderDomain
public abstract class BaseClassLoaderDomain
BaseClassLoaderDomain.
This class hides some of the implementation details and allows package access to the protected methods.
Constructor Summary | |
---|---|
BaseClassLoaderDomain()
|
Method Summary | |
---|---|
protected abstract Package |
afterGetPackage(String name)
Invoked after getPackage is attempted to allow a postload attempt, e.g. |
protected abstract void |
afterGetPackages(Set<Package> packages)
Invoked after getPackages is attempted to allow a postload attempt, e.g. |
protected abstract URL |
afterGetResource(String name)
Invoked after getResource is attempted to allow a postload attempt, e.g. |
protected abstract void |
afterGetResources(String name,
Set<URL> urls)
Invoked after getResources is attempted to allow a postload attempt, e.g. |
protected void |
afterRegisterClassLoader(ClassLoader classLoader,
ClassLoaderPolicy policy)
Invoked after adding a classloader policy |
protected void |
afterUnregisterClassLoader(ClassLoader classLoader,
ClassLoaderPolicy policy)
Invoked after adding a classloader policy |
protected abstract Package |
beforeGetPackage(String name)
Invoked before getPackage is attempted to allow a preload attempt, e.g. |
protected abstract void |
beforeGetPackages(Set<Package> packages)
Invoked before getPackages is attempted to allow a preload attempt, e.g. |
protected abstract URL |
beforeGetResource(String name)
Invoked before getResource is attempted to allow a preload attempt, e.g. |
protected abstract void |
beforeGetResources(String name,
Set<URL> urls)
Invoked before getResources is attempted to allow a preload attempt, e.g. |
protected void |
beforeRegisterClassLoader(ClassLoader classLoader,
ClassLoaderPolicy policy)
Invoked before adding a classloader policy |
protected void |
beforeUnregisterClassLoader(ClassLoader classLoader,
ClassLoaderPolicy policy)
Invoked before adding a classloader policy |
protected Class<?> |
checkClassCacheAndBlackList(BaseClassLoader classLoader,
String name,
String path,
boolean allExports,
boolean failIfBlackListed)
Check the cache and blacklist |
protected void |
clearBlackList(String name)
Cleans the entry with the given name from the blackList |
protected abstract Loader |
findAfterLoader(String name)
Invoked after classloading is attempted to allow a postload attempt, e.g. |
protected abstract Loader |
findBeforeLoader(String name)
Invoked before classloading is attempted to allow a preload attempt, e.g. |
protected Loader |
findLoader(String name)
Find a loader for a class |
void |
flushCaches()
Flush the internal caches |
protected List<ClassLoader> |
getAllClassLoaders()
Get all the classloaders |
int |
getClassBlackListSize()
|
int |
getClassCacheSize()
|
protected List<ClassLoader> |
getClassLoaders(String packageName)
|
protected Map<String,List<ClassLoader>> |
getClassLoadersByPackage()
Get a map of packages to classloader |
protected BaseClassLoaderSystem |
getClassLoaderSystem()
Get the classloader system |
Package |
getPackage(String name)
Get a package |
void |
getPackages(Set<Package> packages)
Get all the packages visible from this loader |
protected ClassLoader |
getParentClassLoader()
Get the parent classloader |
URL |
getResource(String name)
Get a resource |
int |
getResourceBlackListSize()
|
int |
getResourceCacheSize()
|
void |
getResources(String name,
Set<URL> urls)
Get resources |
boolean |
hasClassLoaders()
Whether the domain has classloaders |
abstract boolean |
isUseLoadClassForParent()
Whether to use load class for parent |
Set<String> |
listClassBlackList()
|
Map<String,String> |
listClassCache()
|
Set<String> |
listResourceBlackList()
|
Map<String,URL> |
listResourceCache()
|
protected Class<?> |
loadClass(BaseClassLoader classLoader,
String name,
boolean allExports)
Load a class from the domain |
Class<?> |
loadClass(String name)
Load a class |
protected abstract Class<?> |
loadClassAfter(String name)
Invoked after classloading is attempted to allow a postload attempt, e.g. |
protected abstract Class<?> |
loadClassBefore(String name)
Invoked before classloading is attempted to allow a preload attempt, e.g. |
protected void |
shutdownDomain()
Shutdown the domain |
String |
toLongString()
A long version of toString() |
protected void |
toLongString(StringBuilder builder)
For subclasses to add information for toLongString() |
protected byte[] |
transform(ClassLoader classLoader,
String className,
byte[] byteCode,
ProtectionDomain protectionDomain)
Transform the byte code |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseClassLoaderDomain()
Method Detail |
---|
public void flushCaches()
public int getClassBlackListSize()
public int getClassCacheSize()
public int getResourceBlackListSize()
public int getResourceCacheSize()
public Set<String> listClassBlackList()
public Map<String,String> listClassCache()
public Set<String> listResourceBlackList()
public Map<String,URL> listResourceCache()
protected BaseClassLoaderSystem getClassLoaderSystem()
protected void shutdownDomain()
The default implementation just unregisters all classloaders
public boolean hasClassLoaders()
public abstract boolean isUseLoadClassForParent()
protected byte[] transform(ClassLoader classLoader, String className, byte[] byteCode, ProtectionDomain protectionDomain) throws Exception
By default, this delegates to the classloader system
classLoader
- the classloaderclassName
- the class namebyteCode
- the byte codeprotectionDomain
- the protection domain
Exception
- for any errorprotected Class<?> loadClass(BaseClassLoader classLoader, String name, boolean allExports) throws ClassNotFoundException
classLoader
- the classloadername
- the class nameallExports
- whether we should look at all exports
ClassNotFoundException
- for any errorprotected Loader findLoader(String name)
name
- the class resource name
protected abstract Class<?> loadClassBefore(String name)
name
- the class name
protected abstract Class<?> loadClassAfter(String name)
name
- the class name
protected abstract Loader findBeforeLoader(String name)
name
- the class resource name
protected abstract Loader findAfterLoader(String name)
name
- the class resource name
protected abstract void beforeGetResources(String name, Set<URL> urls) throws IOException
name
- the resource nameurls
- the urls to add to
IOException
- for any errorprotected abstract void afterGetResources(String name, Set<URL> urls) throws IOException
name
- the resource nameurls
- the urls to add to
IOException
- for any errorprotected abstract URL beforeGetResource(String name)
name
- the resource name
protected abstract URL afterGetResource(String name)
name
- the resource name
protected abstract void beforeGetPackages(Set<Package> packages)
packages
- the packages to add toprotected abstract void afterGetPackages(Set<Package> packages)
packages
- the packages to add toprotected abstract Package beforeGetPackage(String name)
name
- the package name
protected abstract Package afterGetPackage(String name)
name
- the package name
public Class<?> loadClass(String name)
Loader
loadClass
in interface Loader
name
- the class name
public URL getResource(String name)
Loader
getResource
in interface Loader
name
- the resource name
public void getResources(String name, Set<URL> urls) throws IOException
Loader
getResources
in interface Loader
name
- the resource nameurls
- the list of urls to add to
IOException
- for any errorpublic Package getPackage(String name)
Loader
getPackage
in interface Loader
name
- the package name
public void getPackages(Set<Package> packages)
Loader
getPackages
in interface Loader
packages
- the packagespublic String toLongString()
protected void toLongString(StringBuilder builder)
builder
- the builderprotected void beforeRegisterClassLoader(ClassLoader classLoader, ClassLoaderPolicy policy)
classLoader
- the classloaderpolicy
- the classloader policyprotected void afterRegisterClassLoader(ClassLoader classLoader, ClassLoaderPolicy policy)
classLoader
- the classloaderpolicy
- the classloader policyprotected void beforeUnregisterClassLoader(ClassLoader classLoader, ClassLoaderPolicy policy)
classLoader
- the classloaderpolicy
- the classloader policyprotected void afterUnregisterClassLoader(ClassLoader classLoader, ClassLoaderPolicy policy)
classLoader
- the classloaderpolicy
- the classloader policyprotected ClassLoader getParentClassLoader()
protected List<ClassLoader> getAllClassLoaders()
protected Map<String,List<ClassLoader>> getClassLoadersByPackage()
protected List<ClassLoader> getClassLoaders(String packageName)
protected Class<?> checkClassCacheAndBlackList(BaseClassLoader classLoader, String name, String path, boolean allExports, boolean failIfBlackListed) throws ClassNotFoundException
classLoader
- the classloader (possibly null)name
- the namepath
- the path of the class resourceallExports
- whether to look at all exportsfailIfBlackListed
- true
if a blacklisted class should
result in ClassNotFoundException; false
if a null
return value is acceptable
ClassNotFoundException
- when the class is blacklisted and
failIfBlackListed
is true
protected void clearBlackList(String name)
name
- the name of the resource to clear from the blackList
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |