org.jboss.classloader.spi.base
Class BaseDelegateLoader

java.lang.Object
  extended by org.jboss.classloader.spi.base.BaseDelegateLoader
All Implemented Interfaces:
Loader
Direct Known Subclasses:
DelegateLoader

public class BaseDelegateLoader
extends Object
implements Loader

Base DelegateLoader.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Constructor Summary
BaseDelegateLoader(BaseClassLoaderPolicy delegate)
          Create a new BaseDelegateLoader.
BaseDelegateLoader(ClassLoaderPolicyFactory factory)
          Create a new BaseDelegateLoader.
 
Method Summary
 Package getPackage(String name)
          Get a package
 void getPackages(Set<Package> packages)
          Get all the packages visible from this loader
 URL getResource(String name)
          Get a resource
 void getResources(String name, Set<URL> urls)
          Get resources
protected  void initialise(ClassLoaderPolicy policy)
          Callback to initialise policy
 Class<?> loadClass(String className)
          Load a class
 String toLongString()
          A long version of toString()
protected  void toLongString(StringBuilder builder)
          For subclasses to add information for toLongString()
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseDelegateLoader

public BaseDelegateLoader(BaseClassLoaderPolicy delegate)
Create a new BaseDelegateLoader.

Parameters:
delegate - the delegate
Throws:
IllegalArgumentException - for a null delegate

BaseDelegateLoader

public BaseDelegateLoader(ClassLoaderPolicyFactory factory)
Create a new BaseDelegateLoader.

Parameters:
factory - the factory
Throws:
IllegalArgumentException - for a null factory
Method Detail

initialise

protected void initialise(ClassLoaderPolicy policy)
Callback to initialise policy

Parameters:
policy - the policy

loadClass

public Class<?> loadClass(String className)
Description copied from interface: Loader
Load a class

Specified by:
loadClass in interface Loader
Parameters:
className - the class name
Returns:
the class or null if not found

getResource

public URL getResource(String name)
Description copied from interface: Loader
Get a resource

Specified by:
getResource in interface Loader
Parameters:
name - the resource name
Returns:
the url or null if not found

getResources

public void getResources(String name,
                         Set<URL> urls)
                  throws IOException
Description copied from interface: Loader
Get resources

Specified by:
getResources in interface Loader
Parameters:
name - the resource name
urls - the list of urls to add to
Throws:
IOException - for any error

getPackage

public Package getPackage(String name)
Description copied from interface: Loader
Get a package

Specified by:
getPackage in interface Loader
Parameters:
name - the package name
Returns:
the package

getPackages

public void getPackages(Set<Package> packages)
Description copied from interface: Loader
Get all the packages visible from this loader

Specified by:
getPackages in interface Loader
Parameters:
packages - the packages

toLongString

public String toLongString()
A long version of toString()

Returns:
the long string

toLongString

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

Parameters:
builder - the builder

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.