01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.jmx.adaptor.http;
09:
10: /**
11: *
12: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
13: */
14:
15: public class CommandLoader {
16:
17: public static Command loadCommand(String name) throws Exception {
18: String command = CommandLoader.class.getPackage().getName()
19: + "." + name + "Command";
20: return (Command) (Thread.currentThread()
21: .getContextClassLoader().loadClass(command)
22: .newInstance());
23: }
24:
25: }
|