org.jboss.classloader.spi.base
Class BaseClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by org.jboss.classloader.spi.base.BaseClassLoader
All Implemented Interfaces:
BaseClassLoaderMBean, org.jboss.classloading.spi.RealClassLoader, org.jboss.util.loading.Translatable

public class BaseClassLoader
extends SecureClassLoader
implements BaseClassLoaderMBean, org.jboss.classloading.spi.RealClassLoader

BaseClassLoader.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Constructor Summary
BaseClassLoader(ClassLoaderPolicy policy)
          Create a new ClassLoader with no parent.
 
Method Summary
 void clearBlackList(String name)
           
protected  void definePackage(String className)
          Define the package for the class if not already done
protected  Enumeration<URL> findResources(String name)
           
 Class<?> getCachedClass(String name)
           
 URL getCachedResource(String name)
           
 ObjectName getObjectName()
           
 URL getResource(String name)
           
 URL getResourceLocally(String name)
          Try to find the resource locally
 boolean isValid()
           
protected  Class<?> loadClass(String name, boolean resolve)
           
protected  Class<?> loadClassFromDomain(String name, boolean trace)
          Try to load the class from the domain
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.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseClassLoader

public BaseClassLoader(ClassLoaderPolicy policy)
Create a new ClassLoader with no parent.

Parameters:
policy - the policy
Throws:
IllegalArgumentException - for a null policy
IllegalStateException - if the policy is already associated with a classloader
Method Detail

getObjectName

public ObjectName getObjectName()
Specified by:
getObjectName in interface org.jboss.classloading.spi.RealClassLoader

loadClass

protected Class<?> loadClass(String name,
                             boolean resolve)
                      throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

findResources

protected Enumeration<URL> findResources(String name)
                                  throws IOException
Overrides:
findResources in class ClassLoader
Throws:
IOException

getResourceLocally

public URL getResourceLocally(String name)
Try to find the resource locally

Specified by:
getResourceLocally in interface org.jboss.util.loading.Translatable
Parameters:
name - the resource name
Returns:
the url if found

definePackage

protected void definePackage(String className)
Define the package for the class if not already done

Parameters:
className - the class name

loadClassFromDomain

protected Class<?> loadClassFromDomain(String name,
                                       boolean trace)
                                throws ClassNotFoundException
Try to load the class from the domain

Parameters:
name - the class name
trace - whether trace is enabled
Returns:
the class if found in the parent
Throws:
ClassNotFoundException - for any error

isValid

public boolean isValid()
Specified by:
isValid in interface org.jboss.classloading.spi.RealClassLoader

getCachedClass

public Class<?> getCachedClass(String name)
Specified by:
getCachedClass in interface org.jboss.classloading.spi.RealClassLoader

getCachedResource

public URL getCachedResource(String name)
Specified by:
getCachedResource in interface org.jboss.classloading.spi.RealClassLoader

clearBlackList

public void clearBlackList(String name)

toLongString

public String toLongString()
A long version of the classloader

Returns:
the long string

shutdownClassLoader

protected void shutdownClassLoader()
Shutdown the classloader


toLongString

protected void toLongString(StringBuilder builder)
For subclasses to add things to the long string

Parameters:
builder - the builder

toString

public String toString()
Overrides:
toString in class Object


Copyright ? 2007 JBoss Inc.. All Rights Reserved.