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

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


org.jboss.mx.loading
Class HeirarchicalLoaderRepository4

java.lang.Object
  extended byorg.jboss.mx.loading.LoaderRepository
      extended byorg.jboss.mx.loading.UnifiedLoaderRepository4
          extended byorg.jboss.mx.loading.HeirarchicalLoaderRepository4
All Implemented Interfaces:
ClassLoaderRepository, NotificationBroadcaster, ServerConstants, UnifiedLoaderRepository4MBean, UnifiedLoaderRepositoryMBean

public class HeirarchicalLoaderRepository4
extends UnifiedLoaderRepository4

A simple extension of UnifiedLoaderRepository3 that adds the notion of a parent UnifiedLoaderRepository. Classes and resources are loaded from child first and then the parent depending on the java2ParentDelegaton flag.

Version:
$Revision: 1.1.2.3 $
Author:
Scott.Stark@jboss.org

Field Summary
 
Fields inherited from class org.jboss.mx.loading.LoaderRepository
instance, loaders, nativeClassBySignature, translator
 
Fields inherited from interface org.jboss.mx.server.ServerConstants
CLASS_REMOVED, CLASSLOADER, CLASSLOADER_ADDED, CLASSLOADER_REMOVED, DEFAULT_DOMAIN, 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
HeirarchicalLoaderRepository4(MBeanServer server)
           
HeirarchicalLoaderRepository4(MBeanServer server, ObjectName parentName)
           
HeirarchicalLoaderRepository4(UnifiedLoaderRepository4 parentRepository)
           
 
Method Summary
 UnifiedClassLoader4 getClassLoader(String name)
          Called by LoadMgr to obtain all class loaders.
 URL getResource(String name, ClassLoader scl)
          Find a resource from this repository.
 void getResources(String name, ClassLoader cl, List urls)
          Find all resource URLs for the given name.
 URL[] getURLs()
          Obtain a listing of the URLs for all UnifiedClassLoaders associated with the repository
 boolean getUseParentFirst()
          Get the use parent first flag.
 Class loadClass(String name, boolean resolve, ClassLoader scl)
          Load a class using the repository class loaders.
 Class loadClassFromCache(String name)
          Called by LoadMgr to locate a previously loaded class.
 UnifiedClassLoader newClassLoader(URL url, boolean addToRepository)
          Create UnifiedClassLoader and optionally add it to the repository
 UnifiedClassLoader newClassLoader(URL url, URL origURL, boolean addToRepository)
          Create UnifiedClassLoader and optionally add it to the repository
 void setUseParentFirst(boolean flag)
          Set the use parent first flag.
 
Methods inherited from class org.jboss.mx.loading.UnifiedLoaderRepository4
addClassLoader, addClassLoaderURL, addNotificationListener, cacheLoadedClass, displayClassInfo, flush, getCacheSize, getClasses, getClassIndexSize, getClassLoaders, getClassLoaders, getClassLoadersSize, getClassNamesMap, getInstance, getLoaderToClassesMap, getNotificationInfo, loadClass, loadClassFromClassLoader, loadClassWithout, registerClassLoader, removeClassLoader, removeNotificationListener
 
Methods inherited from class org.jboss.mx.loading.LoaderRepository
getCachedClass, getDefaultLoaderRepository, getLoaders, getNativeClassForName, getTranslator, loadClassBefore, setTranslator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.mx.loading.UnifiedLoaderRepositoryMBean
getTranslator, setTranslator
 

Constructor Detail

HeirarchicalLoaderRepository4

public HeirarchicalLoaderRepository4(MBeanServer server)
                              throws AttributeNotFoundException,
                                     InstanceNotFoundException,
                                     MBeanException,
                                     ReflectionException

HeirarchicalLoaderRepository4

public HeirarchicalLoaderRepository4(MBeanServer server,
                                     ObjectName parentName)
                              throws AttributeNotFoundException,
                                     InstanceNotFoundException,
                                     MBeanException,
                                     ReflectionException

HeirarchicalLoaderRepository4

public HeirarchicalLoaderRepository4(UnifiedLoaderRepository4 parentRepository)
Method Detail

newClassLoader

public UnifiedClassLoader newClassLoader(URL url,
                                         boolean addToRepository)
                                  throws Exception
Description copied from class: LoaderRepository
Create UnifiedClassLoader and optionally add it to the repository

Specified by:
newClassLoader in interface UnifiedLoaderRepositoryMBean
Overrides:
newClassLoader in class UnifiedLoaderRepository4
Throws:
Exception

newClassLoader

public UnifiedClassLoader newClassLoader(URL url,
                                         URL origURL,
                                         boolean addToRepository)
                                  throws Exception
Description copied from class: LoaderRepository
Create UnifiedClassLoader and optionally add it to the repository

Specified by:
newClassLoader in interface UnifiedLoaderRepositoryMBean
Overrides:
newClassLoader in class UnifiedLoaderRepository4
Throws:
Exception

getUseParentFirst

public boolean getUseParentFirst()
Get the use parent first flag. This indicates whether the parent repository is consulted first for resource and class loading or if the HeirchicalLoaderRepository is consulted first.

Returns:
true if the parent repository is consulted first, false if the HeirchicalLoaderRepository is consulted first.

setUseParentFirst

public void setUseParentFirst(boolean flag)
Set the use parent first flag. This indicates whether the parent repository is consulted first for resource and class loading or if the HeirchicalLoaderRepository is consulted first.

Parameters:
flag - true if the parent repository is consulted first, false if the HeirchicalLoaderRepository is consulted first.

loadClass

public Class loadClass(String name,
                       boolean resolve,
                       ClassLoader scl)
                throws ClassNotFoundException
Load a class using the repository class loaders.

Overrides:
loadClass in class UnifiedLoaderRepository4
Parameters:
name - The name of the class
resolve - If true, the class will be resolved
scl - The asking class loader
Returns:
The loaded class
Throws:
ClassNotFoundException - If the class could not be found.

getResource

public URL getResource(String name,
                       ClassLoader scl)
Find a resource from this repository. This first looks to this repository and then the parent repository.

Overrides:
getResource in class UnifiedLoaderRepository4
Parameters:
name - The name of the resource
scl - The asking class loader
Returns:
An URL for reading the resource, or null if the resource could not be found.

getResources

public void getResources(String name,
                         ClassLoader cl,
                         List urls)
Find all resource URLs for the given name. This is entails an exhuastive search of this and the parent repository and is an expensive operation.

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

getURLs

public URL[] getURLs()
Obtain a listing of the URLs for all UnifiedClassLoaders associated with the repository

Specified by:
getURLs in interface UnifiedLoaderRepositoryMBean
Overrides:
getURLs in class UnifiedLoaderRepository4
Returns:
URL[] for the repository classpath

loadClassFromCache

public Class loadClassFromCache(String name)
Called by LoadMgr to locate a previously loaded class. This looks first to this repository and then the parent repository.

Overrides:
loadClassFromCache in class UnifiedLoaderRepository4
Parameters:
name - the fully qualified class name
Returns:
the cached class if found, null otherwise

getClassLoader

public UnifiedClassLoader4 getClassLoader(String name)
Called by LoadMgr to obtain all class loaders. This returns a set of PkgClassLoader with the HeirarchicalLoaderRepository3 ordered ahead of the parent repository pkg class loaders

Specified by:
getClassLoader in interface UnifiedLoaderRepository4MBean
Overrides:
getClassLoader in class UnifiedLoaderRepository4
Returns:
UnifiedClassLoader4 for name


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