javax.management
Class DefaultLoaderRepository

java.lang.Object
  extended by javax.management.DefaultLoaderRepository

Deprecated. Use MBeanServer.getClassLoaderRepository() instead.

@Deprecated
public class DefaultLoaderRepository
extends Object

Maintains a list of the ClassLoader instances registered with the management servers, allowing it to be used to load classes. In early versions of the JMX API, this class represented a shared repository for the classloaders of all management servers. The management of classloaders is now decentralised and this class is deprecated. The old behaviour is emulated by consulting the MBeanServer.getClassLoaderRepository() method of all the servers obtained from MBeanServerFactory.findMBeanServer(String). Use of this class should be avoided in new code.

Since:
1.5

Constructor Summary
DefaultLoaderRepository()
          Deprecated.  
 
Method Summary
static Class loadClass(String name)
          Deprecated. Attempts to load the given class using class loaders supplied by the repository of each MBeanServer.
static Class loadClassWithout(ClassLoader exclude, String name)
          Deprecated.  Attempts to load the given class using class loaders supplied by the repository of each MBeanServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLoaderRepository

public DefaultLoaderRepository()
Deprecated. 
Method Detail

loadClass

public static Class loadClass(String name)
                       throws ClassNotFoundException
Deprecated. 
Attempts to load the given class using class loaders supplied by the repository of each MBeanServer. The ClassLoader.loadClass(String) method of each class loader is called. If the method returns successfully, then the returned Class instance is returned. If a ClassNotFoundException is thrown, then the next loader is tried. Any other exception thrown by the method is passed back to the caller. This method throws a ClassNotFoundException itself if all the class loaders listed prove fruitless.

Parameters:
name - the name of the class to load.
Returns:
the loaded class.
Throws:
ClassNotFoundException - if all the class loaders fail to load the class.

loadClassWithout

public static Class loadClassWithout(ClassLoader exclude,
                                     String name)
                              throws ClassNotFoundException
Deprecated. 

Attempts to load the given class using class loaders supplied by the repository of each MBeanServer. The ClassLoader.loadClass(String) method of each class loader is called. If the method returns successfully, then the returned Class instance is returned. If a ClassNotFoundException is thrown, then the next loader is tried. Any other exception thrown by the method is passed back to the caller. This method throws a ClassNotFoundException itself if all the class loaders listed prove fruitless.

Note that this method may deadlock if called simultaneously by two class loaders in the list. loadClassBefore(ClassLoader, String) should be used in preference to this method to avoid this.

Parameters:
exclude - the class loader to exclude, or null to obtain the same behaviour as loadClass(String).
name - the name of the class to load.
Returns:
the loaded class.
Throws:
ClassNotFoundException - if all the class loaders fail to load the class.