站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 jmx API Documentation 英文版文档

LoaderRepository (JBoss/JMX API) - JBoss 3.2.7 jmx API Documentation 英文版文档


org.jboss.mx.loading
Class LoaderRepository

java.lang.Object
  extended byorg.jboss.mx.loading.LoaderRepository
All Implemented Interfaces:
ClassLoaderRepository, ServerConstants
Direct Known Subclasses:
BasicLoaderRepository, UnifiedLoaderRepository, UnifiedLoaderRepository2, UnifiedLoaderRepository3, UnifiedLoaderRepository4

public abstract class LoaderRepository
extends Object
implements ServerConstants, ClassLoaderRepository

Version:
$Revision: 1.4.4.8 $
Author:
Juha Lindfors., Scott.Stark@jboss.org
See Also:
DefaultLoaderRepository, BasicLoaderRepository

Field Summary
protected static LoaderRepository instance
           
protected static Vector loaders
           
protected static HashMap nativeClassBySignature
          Native signature to class map
protected  org.jboss.util.loading.Translator translator
           
 
Fields inherited from interface org.jboss.mx.server.ServerConstants
CLASS_REMOVED, CLASSLOADER, CLASSLOADER_ADDED, CLASSLOADER_REMOVED, DEFAULT_DOMAIN, DEFAULT_LOADER_NAME, DEFAULT_LOADER_REPOSITORY_CLASS, DEFAULT_MBEAN_REGISTRY_CLASS, DEFAULT_MBEAN_SERVER_BUILDER_CLASS, DEFAULT_REQUIRED_MODELMBEAN_CLASS, DEFAULT_SCOPED_REPOSITORY_CLASS, DEFAULT_SCOPED_REPOSITORY_PARSER_CLASS, IMPLEMENTATION_NAME, IMPLEMENTATION_VENDOR, IMPLEMENTATION_VERSION, JMI_DOMAIN, LOADER_REPOSITORY_CLASS_PROPERTY, MBEAN_REGISTRY, MBEAN_REGISTRY_CLASS_PROPERTY, MBEAN_SERVER_BUILDER_CLASS_PROPERTY, MBEAN_SERVER_CONFIGURATION, MBEAN_SERVER_DELEGATE, OPTIMIZE_REFLECTED_DISPATCHER, REQUIRED_MODELMBEAN_CLASS_PROPERTY, SPECIFICATION_NAME, SPECIFICATION_VENDOR, SPECIFICATION_VERSION, UNIFIED_LOADER_REPOSITORY_CLASS
 
Constructor Summary
LoaderRepository()
           
 
Method Summary
abstract  void addClassLoader(ClassLoader cl)
          Add a class loader to the repository
abstract  boolean addClassLoaderURL(ClassLoader cl, URL url)
          Update the set of URLs known to be associated with a previously added class loader.
 Class getCachedClass(String classname)
           
static LoaderRepository getDefaultLoaderRepository()
           
 Vector getLoaders()
           
static Class getNativeClassForName(String className)
          Return the class of a java native type
abstract  URL getResource(String name, ClassLoader cl)
          Find a resource URL for the given name
abstract  void getResources(String name, ClassLoader cl, List urls)
          Find all resource URLs for the given name.
 org.jboss.util.loading.Translator getTranslator()
           
 URL[] getURLs()
           
abstract  Class loadClass(String className)
          Load the given class from the repository.
abstract  Class loadClass(String name, boolean resolve, ClassLoader cl)
          Load the given class from the repository
 Class loadClassBefore(ClassLoader cl, String className)
          Load the given class from the repository using classloaders before this classloader.
abstract  Class loadClassWithout(ClassLoader loader, String className)
          Not used.
abstract  UnifiedClassLoader newClassLoader(URL url, boolean addToRepository)
          Create UnifiedClassLoader and optionally add it to the repository
abstract  UnifiedClassLoader newClassLoader(URL url, URL origURL, boolean addToRepository)
          Create UnifiedClassLoader and optionally add it to the repository
abstract  void removeClassLoader(ClassLoader cl)
          Remove a cladd loader from the repository.
 void setTranslator(org.jboss.util.loading.Translator t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loaders

protected static Vector loaders

instance

protected static LoaderRepository instance

translator

protected org.jboss.util.loading.Translator translator

nativeClassBySignature

protected static final HashMap nativeClassBySignature
Native signature to class map

Constructor Detail

LoaderRepository

public LoaderRepository()
Method Detail

getDefaultLoaderRepository

public static LoaderRepository getDefaultLoaderRepository()

getLoaders

public Vector getLoaders()

getURLs

public URL[] getURLs()

getCachedClass

public Class getCachedClass(String classname)

getTranslator

public org.jboss.util.loading.Translator getTranslator()

setTranslator

public void setTranslator(org.jboss.util.loading.Translator t)

newClassLoader

public abstract UnifiedClassLoader newClassLoader(URL url,
                                                  boolean addToRepository)
                                           throws Exception
Create UnifiedClassLoader and optionally add it to the repository

Parameters:
url - the URL to use for class loading
addToRepository - a flag indicating if the UCL should be added to the repository
Returns:
the UCL instance
Throws:
Exception

newClassLoader

public abstract UnifiedClassLoader newClassLoader(URL url,
                                                  URL origURL,
                                                  boolean addToRepository)
                                           throws Exception
Create UnifiedClassLoader and optionally add it to the repository

Parameters:
url - the URL to use for class loading
origURL - an orignal URL to use as the URL for the UCL CodeSource. This is useful when the url is a local copy that is difficult to use for security policy writing.
addToRepository - a flag indicating if the UCL should be added to the repository
Returns:
the UCL instance
Throws:
Exception

loadClass

public abstract Class loadClass(String className)
                         throws ClassNotFoundException
Load the given class from the repository.

Specified by:
loadClass in interface ClassLoaderRepository
Parameters:
className -
Returns:
Throws:
ClassNotFoundException

loadClassBefore

public Class loadClassBefore(ClassLoader cl,
                             String className)
                      throws ClassNotFoundException
Load the given class from the repository using classloaders before this classloader.

Specified by:
loadClassBefore in interface ClassLoaderRepository
Parameters:
cl - the classloader
className - the class name
Returns:
the class
Throws:
ClassNotFoundException - for not found

loadClass

public abstract Class loadClass(String name,
                                boolean resolve,
                                ClassLoader cl)
                         throws ClassNotFoundException
Load the given class from the repository

Parameters:
name -
resolve -
cl -
Returns:
Throws:
ClassNotFoundException

getResource

public abstract URL getResource(String name,
                                ClassLoader cl)
Find a resource URL for the given name

Parameters:
name - the resource name
cl - the requesting class loader
Returns:
The resource URL if found, null otherwise

getResources

public abstract void getResources(String name,
                                  ClassLoader cl,
                                  List urls)
Find all resource URLs for the given name. Since this typically entails an exhuastive search of the repository it can be a relatively slow operation.

Parameters:
name - the resource name
cl - the requesting class loader
urls - a list into which the located resource URLs will be placed

loadClassWithout

public abstract Class loadClassWithout(ClassLoader loader,
                                       String className)
                                throws ClassNotFoundException
Not used.

Specified by:
loadClassWithout in interface ClassLoaderRepository
Parameters:
loader -
className -
Returns:
Throws:
ClassNotFoundException

addClassLoader

public abstract void addClassLoader(ClassLoader cl)
Add a class loader to the repository


addClassLoaderURL

public abstract boolean addClassLoaderURL(ClassLoader cl,
                                          URL url)
Update the set of URLs known to be associated with a previously added class loader.

Parameters:
cl -
url -

removeClassLoader

public abstract void removeClassLoader(ClassLoader cl)
Remove a cladd loader from the repository.

Parameters:
cl -

getNativeClassForName

public static final Class getNativeClassForName(String className)
Return the class of a java native type

Returns:
the class, or null if className is not a native class name


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.