org.jboss.classloading.spi
Interface DomainClassLoader


public interface DomainClassLoader

A classloader that can be put in a domain

Version:
$Revision: 69888 $
Author:
Adrian Brock

Method Summary
 Enumeration<URL> findResourcesLocally(String name)
          Find resources locally
 URL[] getClasspath()
          Get the classpath
 ClassLoadingDomain getDomain()
          The domain of the classloader
 Package getPackage(String name)
          Get a package defined by the classloader
 String[] getPackageNames()
          Get the possible package names associated with the class loader.
 Package[] getPackages()
          Get the packages defined by the classloader
 Class<?> loadClass(String name)
          Load a class
 Class<?> loadClassLocally(String name, boolean resolve)
          Load a class
 URL loadResourceLocally(String name)
          Get a resource
 void setDomain(ClassLoadingDomain domain)
          Set the domain of the classloader
 

Method Detail

getDomain

ClassLoadingDomain getDomain()
The domain of the classloader

Returns:
the domain

setDomain

void setDomain(ClassLoadingDomain domain)
Set the domain of the classloader

Parameters:
domain - the domain

getClasspath

URL[] getClasspath()
Get the classpath

Returns:
the classpath

loadClass

Class<?> loadClass(String name)
                   throws ClassNotFoundException
Load a class

Parameters:
name - the name
Returns:
the class
Throws:
ClassNotFoundException

loadClassLocally

Class<?> loadClassLocally(String name,
                          boolean resolve)
                          throws ClassNotFoundException
Load a class

Parameters:
name - the class name
resolve - whether to resolve the class
Returns:
the class
Throws:
ClassNotFoundException - when there is not class

loadResourceLocally

URL loadResourceLocally(String name)
Get a resource

Parameters:
name - the resource name
Returns:
the resource or null if not found

findResourcesLocally

Enumeration<URL> findResourcesLocally(String name)
                                      throws IOException
Find resources locally

Parameters:
name - the name of the resource
Returns:
the resources
Throws:
IOException - for any error

getPackageNames

String[] getPackageNames()
Get the possible package names associated with the class loader. This may be a superset of the currently defined Packages.

Returns:
unique package names of classes available to the class loader.

getPackages

Package[] getPackages()
Get the packages defined by the classloader

Returns:
the packages

getPackage

Package getPackage(String name)
Get a package defined by the classloader

Parameters:
name - the name of the package
Returns:
the package


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