KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jalisto > se > jmx > server > ri > JalistoMbeanServerRiImpl


1 /*
2  * Jalisto - JAva LIght STOrage
3  * Copyright (C) 2000-2005 Xcalia http://www.xcalia.com
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18  *
19  * Xcalia
20  * 71, rue Desnouettes
21  * 75014 Paris - France
22  * http://www.xcalia.com
23  */

24 package org.objectweb.jalisto.se.jmx.server.ri;
25
26 public class JalistoMbeanServerRiImpl {
27
28 }
29
30 // extends Thread implements FdbMBeanServer {
31
//
32
// public static void main(String[] args) {
33
// String propertiesPath = "fdb.properties";
34
// try {
35
// propertiesPath = args[0];
36
// } catch (Exception e) {
37
// System.out.println("Cannot find properties path argument, use default value = " + propertiesPath);
38
// }
39
//
40
// FdbMbeanServerRiImpl fdbServer = new FdbMbeanServerRiImpl();
41
// fdbServer.init(propertiesPath);
42
// fdbServer.run();
43
// }
44
//
45
// public FdbMbeanServerRiImpl() {
46
// }
47
//
48
// public void init(String propertiesPath) {
49
// this.propertiesPath = propertiesPath;
50
// this.mbeanServer = MBeanServerFactory.createMBeanServer();
51
// this.props = InternalFdbFactory.getProperties(propertiesPath);
52
//
53
// //TODO use FdbProperties
54
// enlistHtmlAdaptorServer(5555);
55
// }
56
//
57
// public void run() {
58
// registerMBean(mbeanServer, CacheAdmin.class.getName());
59
// registerMBean(mbeanServer, MemoryAdmin.class.getName());
60
// registerMBean(mbeanServer, ClassDescriptionAdmin.class.getName());
61
//
62
// System.out.println("FileDB RI MBean server is OK");
63
// }
64
//
65
// public void addSession(String s) {
66
// }
67
//
68
// private void enlistHtmlAdaptorServer(int port) {
69
// try {
70
// HtmlAdaptorServer htmlAdaptor = new HtmlAdaptorServer(); // default constructor: sets port to default 8082
71
// htmlAdaptor.setPort(port);
72
// mbeanServer.registerMBean(htmlAdaptor, null);
73
// htmlAdaptor.start();
74
// while (htmlAdaptor.getState() == CommunicatorServer.STARTING) {
75
// sleep(100);
76
// }
77
// if (htmlAdaptor.getState() != CommunicatorServer.ONLINE) {
78
// throw new MBeanAdminException("Cannot start the FileDB HTML adaptor server");
79
// }
80
// } catch (DatabaseException fdbde) {
81
// throw fdbde;
82
// } catch (Exception e) {
83
// throw new MBeanAdminException("Could not create the FileDB RI HtmlAdaptorServer", e);
84
// }
85
// System.out.println("FileDB RI HtmlAdaptorServer started...");
86
// }
87
//
88
// private void registerMBean(MBeanServer server, String mbeanClassName) {
89
// try {
90
// Object[] params = new Object[1];
91
// params[0] = propertiesPath;
92
// String[] signature = new String[1];
93
// signature[0] = "java.lang.String";
94
// ObjectName mbeanObjectName =
95
// new ObjectName(server.getDefaultDomain() + ":type=" + mbeanClassName);
96
// server.createMBean(mbeanClassName, mbeanObjectName, params, signature);
97
// } catch (Exception e) {
98
// throw new MBeanAdminException(e);
99
// }
100
// }
101
//
102
// private String propertiesPath;
103
// private FdbProperties props;
104
// private MBeanServer mbeanServer;
105
//}
106
Popular Tags