|
||||||||||
| 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 classloader| Method Detail |
|---|
public ObjectName getObjectName()
getObjectName in interface org.jboss.classloading.spi.RealClassLoaderpublic ObjectName getClassLoaderDomain()
BaseClassLoaderMBean
getClassLoaderDomain in interface BaseClassLoaderMBeanpublic String getName()
BaseClassLoaderMBean
getName in interface BaseClassLoaderMBeanpublic boolean isBlackListable()
BaseClassLoaderMBean
isBlackListable in interface BaseClassLoaderMBeanpublic boolean isCacheable()
BaseClassLoaderMBean
isCacheable in interface BaseClassLoaderMBeanpublic boolean isImportAll()
BaseClassLoaderMBean
isImportAll in interface BaseClassLoaderMBeanpublic Set<String> listExportedPackages()
BaseClassLoaderMBean
listExportedPackages in interface BaseClassLoaderMBeanpublic List<ObjectName> listImports()
BaseClassLoaderMBean
listImports in interface BaseClassLoaderMBeanpublic String listPolicyDetails()
BaseClassLoaderMBean
listPolicyDetails in interface BaseClassLoaderMBean
public ObjectName findClassLoaderForClass(String name)
throws ClassNotFoundException
BaseClassLoaderMBean
findClassLoaderForClass in interface BaseClassLoaderMBeanname - the class name
ClassNotFoundException - when the class is not foundpublic Set<String> listLoadedClasses()
BaseClassLoaderMBean
listLoadedClasses in interface BaseClassLoaderMBeanpublic Set<String> listLoadedResourceNames()
BaseClassLoaderMBean
listLoadedResourceNames in interface BaseClassLoaderMBeanpublic Set<URL> listLoadedResources()
BaseClassLoaderMBean
listLoadedResources in interface BaseClassLoaderMBeanprotected Package getPackage(String name)
getPackage in class ClassLoaderprotected 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 permission
protected Class<?> loadClass(String name,
boolean resolve)
throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionpublic URL getResource(String name)
getResource in class ClassLoader
protected Enumeration<URL> findResources(String name)
throws IOException
findResources in class ClassLoaderIOException
public Set<URL> loadResources(String name)
throws IOException
BaseClassLoaderMBean
loadResources in interface BaseClassLoaderMBeanname - the name of the resource
IOException - for any errorpublic URL getResourceLocally(String name)
getResourceLocally in interface org.jboss.util.loading.Translatablename - the resource name
protected void definePackage(String className,
URL codeSourceURL)
className - the class namecodeSourceURL - the code source url
protected 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 BaseClassLoaderMBeanisValid in interface org.jboss.classloading.spi.RealClassLoaderpublic Class<?> getCachedClass(String name)
getCachedClass in interface org.jboss.classloading.spi.RealClassLoaderpublic URL getCachedResource(String name)
getCachedResource in interface org.jboss.classloading.spi.RealClassLoaderpublic int getResourceBlackListSize()
BaseClassLoaderMBean
getResourceBlackListSize in interface BaseClassLoaderMBeanpublic int getResourceCacheSize()
BaseClassLoaderMBean
getResourceCacheSize in interface BaseClassLoaderMBeanpublic Set<String> listResourceBlackList()
BaseClassLoaderMBean
listResourceBlackList in interface BaseClassLoaderMBeanpublic Map<String,URL> listResourceCache()
BaseClassLoaderMBean
listResourceCache in interface BaseClassLoaderMBeanpublic void clearBlackList()
BaseClassLoaderMBean
clearBlackList in interface BaseClassLoaderMBeanpublic void clearBlackList(String name)
BaseClassLoaderMBean
clearBlackList in interface BaseClassLoaderMBeanclearBlackList in interface org.jboss.classloading.spi.RealClassLoadername - 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 | |||||||||