|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
org.jboss.classloader.spi.base.BaseClassLoader
public class BaseClassLoader
BaseClassLoader.
Constructor Summary | |
---|---|
BaseClassLoader(ClassLoaderPolicy policy)
Create a new ClassLoader with no parent. |
Method Summary | |
---|---|
protected Class<?> |
checkCacheAndBlackList(String name,
boolean failIfBlackListed,
boolean trace)
Check the cache and blacklist |
void |
clearBlackList()
Clear the black list |
void |
clearBlackList(String name)
Clear an entry from the black list |
protected void |
definePackage(String className,
URL codeSourceURL)
Define the package for the class if not already done |
ClassLoader |
findClassLoader(String className)
Find the classloader for a class but don't load the class |
ObjectName |
findClassLoaderForClass(String name)
Find the classloader for a class |
protected Enumeration<URL> |
findResources(String name)
|
Class<?> |
getCachedClass(String name)
|
URL |
getCachedResource(String name)
|
ObjectName |
getClassLoaderDomain()
Get the classloader domain |
String |
getName()
Get the name of the classloader |
ObjectName |
getObjectName()
|
protected Package |
getPackage(String name)
|
protected Package[] |
getPackages()
|
URL |
getResource(String name)
|
int |
getResourceBlackListSize()
Get the number of resources black listed |
int |
getResourceCacheSize()
Get the number of resource cached |
URL |
getResourceLocally(String name)
Try to find the resource locally |
boolean |
isBlackListable()
Whether to cache misses |
boolean |
isCacheable()
Whether to cache< |
boolean |
isImportAll()
Whether to import all exports from other classloaders in the domain |
protected Class<?> |
isLoadedClass(String name,
boolean trace)
Check to see if the class is already loaded |
boolean |
isValid()
Whether the classloader is still valid |
Set<String> |
listExportedPackages()
Get the exported packages |
List<ObjectName> |
listImports()
Get the imports of this classloader |
Set<String> |
listLoadedClasses()
Get the loaded classes |
Set<String> |
listLoadedResourceNames()
Get the loaded resource names |
Set<URL> |
listLoadedResources()
Get the loaded resources |
String |
listPolicyDetails()
Get the policy as a string |
Set<String> |
listResourceBlackList()
Show the resource blacklist |
Map<String,URL> |
listResourceCache()
Show the resource cache |
protected Class<?> |
loadClass(String name,
boolean resolve)
|
protected Class<?> |
loadClassFromDomain(String name,
boolean trace)
Try to load the class from the domain |
Set<URL> |
loadResources(String name)
Get resources |
protected void |
shutdownClassLoader()
Shutdown the classloader |
String |
toLongString()
A long version of the classloader |
protected void |
toLongString(StringBuilder builder)
For subclasses to add things to the long string |
String |
toString()
|
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass, getPermissions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.classloader.spi.base.BaseClassLoaderMBean |
---|
loadClass |
Constructor Detail |
---|
public BaseClassLoader(ClassLoaderPolicy policy)
policy
- the policy
IllegalArgumentException
- for a null policy
IllegalStateException
- if the policy is already associated with a classloaderMethod Detail |
---|
public ObjectName getObjectName()
getObjectName
in interface org.jboss.classloading.spi.RealClassLoader
public ObjectName getClassLoaderDomain()
BaseClassLoaderMBean
getClassLoaderDomain
in interface BaseClassLoaderMBean
public String getName()
BaseClassLoaderMBean
getName
in interface BaseClassLoaderMBean
public boolean isBlackListable()
BaseClassLoaderMBean
isBlackListable
in interface BaseClassLoaderMBean
public boolean isCacheable()
BaseClassLoaderMBean
isCacheable
in interface BaseClassLoaderMBean
public boolean isImportAll()
BaseClassLoaderMBean
isImportAll
in interface BaseClassLoaderMBean
public Set<String> listExportedPackages()
BaseClassLoaderMBean
listExportedPackages
in interface BaseClassLoaderMBean
public List<ObjectName> listImports()
BaseClassLoaderMBean
listImports
in interface BaseClassLoaderMBean
public String listPolicyDetails()
BaseClassLoaderMBean
listPolicyDetails
in interface BaseClassLoaderMBean
public ObjectName findClassLoaderForClass(String name) throws ClassNotFoundException
BaseClassLoaderMBean
findClassLoaderForClass
in interface BaseClassLoaderMBean
name
- the class name
ClassNotFoundException
- when the class is not foundpublic Set<String> listLoadedClasses()
BaseClassLoaderMBean
listLoadedClasses
in interface BaseClassLoaderMBean
public Set<String> listLoadedResourceNames()
BaseClassLoaderMBean
listLoadedResourceNames
in interface BaseClassLoaderMBean
public Set<URL> listLoadedResources()
BaseClassLoaderMBean
listLoadedResources
in interface BaseClassLoaderMBean
protected Package getPackage(String name)
getPackage
in class ClassLoader
protected Package[] getPackages()
getPackages
in class ClassLoader
protected Class<?> isLoadedClass(String name, boolean trace)
name
- the name of the classtrace
- whether trace is enabled
protected Class<?> checkCacheAndBlackList(String name, boolean failIfBlackListed, boolean trace) throws ClassNotFoundException
name
- the name of the classfailIfBlackListed
- true
if a blacklisted class should
result in ClassNotFoundException; false
if a null
return value is acceptabletrace
- whether trace is enabled
ClassNotFoundException
- when the class is blacklisted and
failIfBlackListed
is true
public ClassLoader findClassLoader(String className) throws ClassNotFoundException
className
- the class name
ClassNotFoundException
- if the class is not found
IllegalStateException
- if the classloader is not installed
SecurityException
- if the called doesn't have the getClassLoader runtime permissionprotected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
protected Enumeration<URL> findResources(String name) throws IOException
findResources
in class ClassLoader
IOException
public Set<URL> loadResources(String name) throws IOException
BaseClassLoaderMBean
loadResources
in interface BaseClassLoaderMBean
name
- the name of the resource
IOException
- for any errorpublic URL getResourceLocally(String name)
getResourceLocally
in interface org.jboss.util.loading.Translatable
name
- the resource name
protected void definePackage(String className, URL codeSourceURL)
className
- the class namecodeSourceURL
- the code source urlprotected Class<?> loadClassFromDomain(String name, boolean trace) throws ClassNotFoundException
name
- the class nametrace
- whether trace is enabled
ClassNotFoundException
- for any errorpublic boolean isValid()
BaseClassLoaderMBean
isValid
in interface BaseClassLoaderMBean
isValid
in interface org.jboss.classloading.spi.RealClassLoader
public Class<?> getCachedClass(String name)
getCachedClass
in interface org.jboss.classloading.spi.RealClassLoader
public URL getCachedResource(String name)
getCachedResource
in interface org.jboss.classloading.spi.RealClassLoader
public int getResourceBlackListSize()
BaseClassLoaderMBean
getResourceBlackListSize
in interface BaseClassLoaderMBean
public int getResourceCacheSize()
BaseClassLoaderMBean
getResourceCacheSize
in interface BaseClassLoaderMBean
public Set<String> listResourceBlackList()
BaseClassLoaderMBean
listResourceBlackList
in interface BaseClassLoaderMBean
public Map<String,URL> listResourceCache()
BaseClassLoaderMBean
listResourceCache
in interface BaseClassLoaderMBean
public void clearBlackList()
BaseClassLoaderMBean
clearBlackList
in interface BaseClassLoaderMBean
public void clearBlackList(String name)
BaseClassLoaderMBean
clearBlackList
in interface BaseClassLoaderMBean
clearBlackList
in interface org.jboss.classloading.spi.RealClassLoader
name
- the name of the entry to removepublic String toLongString()
protected void shutdownClassLoader()
protected void toLongString(StringBuilder builder)
builder
- the builderpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |