01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management.loading;
10:
11: /**
12: * A repository for ClassLoader MBeans.
13: * A ClassLoaderRepository contains the ClassLoader that loaded the MBeanServer and
14: * registered MBeans that are ClassLoader subclasses and that does not implement the
15: * {@link PrivateClassLoader} interface.
16: * The order of registration for ClassLoader MBeans is important, as it will define
17: * the behavior of MLets, see {@link MLet#findClass}; the MBeanServer's ClassLoader is
18: * always the first ClassLoader.
19: *
20: * @version $Revision: 1.6 $
21: * @see MLet
22: * @see javax.management.MBeanServer#getClassLoaderRepository
23: */
24: public interface ClassLoaderRepository {
25: /**
26: * Loads the given class iterating through the list of classloaders contained in this repository,
27: * from the first to the last.
28: * The method returns as soon as the class is found, or throws a ClassNotFoundException
29: *
30: * @param className The name of the class to load
31: * @return The loaded class
32: * @throws ClassNotFoundException If the class is not found
33: * @see #loadClassBefore
34: */
35: public Class loadClass(String className)
36: throws ClassNotFoundException;
37:
38: /**
39: * Loads the given class iterating through the list of classloaders contained in this repository,
40: * from the first to the last, excluded the specified ClassLoader.
41: * The method returns as soon as the class is found, or throws a ClassNotFoundException
42: *
43: * @param loader The ClassLoader that should not be asked to load the class
44: * @param className The name of the class to load
45: * @return The loaded class
46: * @throws ClassNotFoundException If the class is not found
47: * @see #loadClassBefore
48: */
49: public Class loadClassWithout(ClassLoader loader, String className)
50: throws ClassNotFoundException;
51:
52: /**
53: * Loads the given class iterating through the list of classloaders contained in this repository,
54: * from the first to the specified ClassLoader (that is not asked to load the class).
55: *
56: * @param loader The ClassLoader that should not be asked to load the class and where the search must stop
57: * @param className The name of the class to load
58: * @return The loaded class
59: * @throws ClassNotFoundException If the class is not found
60: */
61: public Class loadClassBefore(ClassLoader loader, String className)
62: throws ClassNotFoundException;
63: }
|