mx4j.server
Class DefaultClassLoaderRepository

java.lang.Object
  extended by mx4j.server.ModifiableClassLoaderRepository
      extended by mx4j.server.DefaultClassLoaderRepository
All Implemented Interfaces:
javax.management.loading.ClassLoaderRepository

public class DefaultClassLoaderRepository
extends ModifiableClassLoaderRepository

Default implementation of a ClassLoaderRepository

Version:
$Revision: 1.8 $

Constructor Summary
DefaultClassLoaderRepository()
           
 
Method Summary
protected  void addClassLoader(java.lang.ClassLoader cl)
          Adds, if does not already exist, the specified ClassLoader to this repository.
protected  java.util.ArrayList cloneClassLoaders()
           
protected  java.util.ArrayList getClassLoaders()
           
 java.lang.Class loadClass(java.lang.String className)
          Loads the given class iterating through the list of classloaders contained in this repository, from the first to the last.
 java.lang.Class loadClassBefore(java.lang.ClassLoader loader, java.lang.String className)
          Loads the given class iterating through the list of classloaders contained in this repository, from the first to the specified ClassLoader (that is not asked to load the class).
 java.lang.Class loadClassWithout(java.lang.ClassLoader loader, java.lang.String className)
          Loads the given class iterating through the list of classloaders contained in this repository, from the first to the last, excluded the specified ClassLoader.
protected  void removeClassLoader(java.lang.ClassLoader cl)
          Removes, if exists, the specified ClassLoader from this repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClassLoaderRepository

public DefaultClassLoaderRepository()
Method Detail

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
Description copied from interface: javax.management.loading.ClassLoaderRepository
Loads the given class iterating through the list of classloaders contained in this repository, from the first to the last. The method returns as soon as the class is found, or throws a ClassNotFoundException

Parameters:
className - The name of the class to load
Returns:
The loaded class
Throws:
java.lang.ClassNotFoundException - If the class is not found
See Also:
ClassLoaderRepository.loadClassBefore(java.lang.ClassLoader, java.lang.String)

loadClassWithout

public java.lang.Class loadClassWithout(java.lang.ClassLoader loader,
                                        java.lang.String className)
                                 throws java.lang.ClassNotFoundException
Description copied from interface: javax.management.loading.ClassLoaderRepository
Loads the given class iterating through the list of classloaders contained in this repository, from the first to the last, excluded the specified ClassLoader. The method returns as soon as the class is found, or throws a ClassNotFoundException

Parameters:
loader - The ClassLoader that should not be asked to load the class
className - The name of the class to load
Returns:
The loaded class
Throws:
java.lang.ClassNotFoundException - If the class is not found
See Also:
ClassLoaderRepository.loadClassBefore(java.lang.ClassLoader, java.lang.String)

loadClassBefore

public java.lang.Class loadClassBefore(java.lang.ClassLoader loader,
                                       java.lang.String className)
                                throws java.lang.ClassNotFoundException
Description copied from interface: javax.management.loading.ClassLoaderRepository
Loads the given class iterating through the list of classloaders contained in this repository, from the first to the specified ClassLoader (that is not asked to load the class).

Parameters:
loader - The ClassLoader that should not be asked to load the class and where the search must stop
className - The name of the class to load
Returns:
The loaded class
Throws:
java.lang.ClassNotFoundException - If the class is not found

addClassLoader

protected void addClassLoader(java.lang.ClassLoader cl)
Description copied from class: ModifiableClassLoaderRepository
Adds, if does not already exist, the specified ClassLoader to this repository.

Specified by:
addClassLoader in class ModifiableClassLoaderRepository
Parameters:
cl - The classloader to add
See Also:
ModifiableClassLoaderRepository.removeClassLoader(java.lang.ClassLoader)

removeClassLoader

protected void removeClassLoader(java.lang.ClassLoader cl)
Description copied from class: ModifiableClassLoaderRepository
Removes, if exists, the specified ClassLoader from this repository.

Specified by:
removeClassLoader in class ModifiableClassLoaderRepository
Parameters:
cl - The classloader to remove
See Also:
ModifiableClassLoaderRepository.addClassLoader(java.lang.ClassLoader)

cloneClassLoaders

protected java.util.ArrayList cloneClassLoaders()

getClassLoaders

protected java.util.ArrayList getClassLoaders()


Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.