1 | // jademx - JADE management using JMX |
2 | // Copyright 2005 Caboodle Networks, Inc. |
3 | // |
4 | // This library is free software; you can redistribute it and/or |
5 | // modify it under the terms of the GNU Lesser General Public |
6 | // License as published by the Free Software Foundation; either |
7 | // version 2.1 of the License, or (at your option) any later version. |
8 | // |
9 | // This library is distributed in the hope that it will be useful, |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | // Lesser General Public License for more details. |
13 | // |
14 | // You should have received a copy of the GNU Lesser General Public |
15 | // License along with this library; if not, write to the Free Software |
16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
17 | |
18 | package jade.jademx.server; |
19 | |
20 | import java.lang.management.ManagementFactory; // J2SE 5.0 |
21 | import javax.management.MBeanServer; |
22 | |
23 | /** |
24 | * JadeMXServer for the Java platform. |
25 | * All instances within a given JVM are equivalent. |
26 | * @author David Bernstein, <a href="http://www.caboodlenetworks.com" |
27 | * >Caboodle Networks, Inc.</a> |
28 | */ |
29 | public class JavaPlatform implements JadeMXServer { |
30 | |
31 | /** the platform MBean server */ |
32 | private MBeanServer mBeanServer; |
33 | |
34 | /** |
35 | * the JadeMXServer for the java platform |
36 | */ |
37 | public JavaPlatform() { |
38 | mBeanServer = ManagementFactory.getPlatformMBeanServer(); |
39 | } |
40 | |
41 | /* (non-Javadoc) |
42 | * @see jade.jademx.server.JadeMXServer#getMBeanServer() |
43 | */ |
44 | public MBeanServer getMBeanServer() { |
45 | return mBeanServer; |
46 | } |
47 | |
48 | /* (non-Javadoc) |
49 | * @see java.lang.Object#toString() |
50 | */ |
51 | public String toString() { |
52 | return getClass().getCanonicalName(); |
53 | } |
54 | |
55 | } |