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: import javax.management.MBeanServer;
11: import javax.management.ObjectName;
12:
13: /**
14: *
15: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
16: */
17:
18: public class UnregisterMBeanCommand extends AbstractCommand {
19:
20: public void doGet(HttpRequest request, HttpResponse response)
21: throws Exception {
22: MBeanServer server = request.getThread().getServer()
23: .getServer();
24: String _objectName = request.getParameter("objectname");
25: if (_objectName != null && _objectName.trim().length() != 0) {
26: ObjectName objectName = new ObjectName(_objectName);
27: server.unregisterMBean(objectName);
28: }
29: throw new HttpRedirectException("/");
30: }
31:
32: public static void main(String[] args) {
33:
34: }
35:
36: }
|