01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package javax.management;
09:
10: import javax.management.loading.ClassLoaderRepository;
11:
12: /**
13: * Keeps the list of Class Loaders registered in the MBean Server.
14: * It provides the necessary methods to load classes using the registered Class Loaders.
15: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
16: * @deprecated Use MBeanServerFactory.getClassLoaderRepository(javax.management.MBeanServer) instead.
17: */
18:
19: public class DefaultLoaderRepository {
20:
21: private static ClassLoaderRepository clrepo = MBeanServerFactory
22: .getClassLoaderRepository(null);
23:
24: public DefaultLoaderRepository() {
25:
26: }
27:
28: public static Class loadClass(String classname)
29: throws ClassNotFoundException {
30: if (clrepo == null)
31: throw new ClassNotFoundException(classname);
32: else
33: return clrepo.loadClass(classname);
34: }
35:
36: public static Class loadClassWithout(ClassLoader loader,
37: String classname) throws ClassNotFoundException {
38: if (clrepo == null)
39: throw new ClassNotFoundException(classname);
40: else
41: return clrepo.loadClassWithout(loader, classname);
42: }
43: }
|