org.jboss.classloader.spi
Class ClassLoaderDomain

java.lang.Object
  extended by org.jboss.classloader.spi.base.BaseClassLoaderDomain
      extended by org.jboss.classloader.spi.ClassLoaderDomain
All Implemented Interfaces:
Loader

public class ClassLoaderDomain
extends BaseClassLoaderDomain
implements Loader

ClassLoaderDomain.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Constructor Summary
ClassLoaderDomain(String name)
          Create a new ClassLoaderDomain with the ParentPolicy.BEFORE loading rules.
 
Method Summary
protected  URL afterGetResource(String name)
          Invoked after getResource is attempted to allow a postload attempt, e.g.
protected  void afterGetResources(String name, Set<URL> urls)
          Invoked after getResources is attempted to allow a postload attempt, e.g.
protected  URL beforeGetResource(String name)
          Invoked before getResource is attempted to allow a preload attempt, e.g.
protected  void beforeGetResources(String name, Set<URL> urls)
          Invoked before getResources is attempted to allow a preload attempt, e.g.
protected  Loader findAfterLoader(String name)
          Invoked after classloading is attempted to allow a postload attempt, e.g.
protected  Loader findBeforeLoader(String name)
          Invoked before classloading is attempted to allow a preload attempt, e.g.
protected  Loader findLoaderFromParent(String name)
          Try to find a loader from the parent
 String getName()
          Get the name.
 Loader getParent()
          Get the parent
 ParentPolicy getParentPolicy()
          Get the parent policy
protected  URL getResourceFromParent(String name)
          Try to get a resource from the parent
protected  void getResourcesFromParent(String name, Set<URL> urls)
          Try to get resources from the parent
 void setParent(Loader parent)
          Set the parent.
 void setParentPolicy(ParentPolicy parentPolicy)
          Set the parentPolicy.
protected  void toLongString(StringBuilder builder)
          For subclasses to add information for toLongString()
 String toString()
           
 
Methods inherited from class org.jboss.classloader.spi.base.BaseClassLoaderDomain
afterRegisterClassLoader, afterUnregisterClassLoader, beforeRegisterClassLoader, beforeUnregisterClassLoader, clearBlackList, findLoader, flushCaches, getParentClassLoader, getResource, getResources, hasClassLoaders, loadClass, shutdownDomain, toLongString, transform
 
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.Loader
getResource, getResources, loadClass
 

Constructor Detail

ClassLoaderDomain

public ClassLoaderDomain(String name)
Create a new ClassLoaderDomain with the ParentPolicy.BEFORE loading rules.

Parameters:
name - the name of the domain
Throws:
IllegalArgumentException - for a null name
Method Detail

getName

public String getName()
Get the name.

Returns:
the name.

getParentPolicy

public ParentPolicy getParentPolicy()
Get the parent policy

Returns:
the parent policy.

setParentPolicy

public void setParentPolicy(ParentPolicy parentPolicy)
Set the parentPolicy.

Parameters:
parentPolicy - the parentPolicy.
Throws:
IllegalArgumentException - for a null parent policy

getParent

public Loader getParent()
Get the parent

Returns:
the parent.

setParent

public void setParent(Loader parent)
Set the parent.

Parameters:
parent - the parent.

toLongString

protected void toLongString(StringBuilder builder)
For subclasses to add information for toLongString()

Overrides:
toLongString in class BaseClassLoaderDomain
Parameters:
builder - the builder

toString

public String toString()
Overrides:
toString in class Object

findBeforeLoader

protected Loader findBeforeLoader(String name)
Description copied from class: BaseClassLoaderDomain
Invoked before classloading is attempted to allow a preload attempt, e.g. from the parent

Specified by:
findBeforeLoader in class BaseClassLoaderDomain
Parameters:
name - the class resource name
Returns:
the loader if found or null otherwise

findAfterLoader

protected Loader findAfterLoader(String name)
Description copied from class: BaseClassLoaderDomain
Invoked after classloading is attempted to allow a postload attempt, e.g. from the parent

Specified by:
findAfterLoader in class BaseClassLoaderDomain
Parameters:
name - the class resource name
Returns:
the loader if found or null otherwise

findLoaderFromParent

protected Loader findLoaderFromParent(String name)
Try to find a loader from the parent

Parameters:
name - the name
Returns:
the loader if found

beforeGetResource

protected URL beforeGetResource(String name)
Description copied from class: BaseClassLoaderDomain
Invoked before getResource is attempted to allow a preload attempt, e.g. from the parent

Specified by:
beforeGetResource in class BaseClassLoaderDomain
Parameters:
name - the resource name
Returns:
the url if found or null otherwise

afterGetResource

protected URL afterGetResource(String name)
Description copied from class: BaseClassLoaderDomain
Invoked after getResource is attempted to allow a postload attempt, e.g. from the parent

Specified by:
afterGetResource in class BaseClassLoaderDomain
Parameters:
name - the class name
Returns:
the url if found or null otherwise

getResourceFromParent

protected URL getResourceFromParent(String name)
Try to get a resource from the parent

Parameters:
name - the name
Returns:
the url if found

beforeGetResources

protected void beforeGetResources(String name,
                                  Set<URL> urls)
                           throws IOException
Description copied from class: BaseClassLoaderDomain
Invoked before getResources is attempted to allow a preload attempt, e.g. from the parent

Specified by:
beforeGetResources in class BaseClassLoaderDomain
Parameters:
name - the resource name
urls - the urls to add to
Throws:
IOException - for any error

afterGetResources

protected void afterGetResources(String name,
                                 Set<URL> urls)
                          throws IOException
Description copied from class: BaseClassLoaderDomain
Invoked after getResources is attempted to allow a postload attempt, e.g. from the parent

Specified by:
afterGetResources in class BaseClassLoaderDomain
Parameters:
name - the resource name
urls - the urls to add to
Throws:
IOException - for any error

getResourcesFromParent

protected void getResourcesFromParent(String name,
                                      Set<URL> urls)
                               throws IOException
Try to get resources from the parent

Parameters:
name - the name
urls - the urls to add to
Throws:
IOException - for any error


Copyright ? 2007 JBoss Inc.. All Rights Reserved.