KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > compliance > server > support > TestMBeanServerBuilder


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package test.compliance.server.support;
9
10 import javax.management.MBeanServer;
11 import javax.management.MBeanServerBuilder;
12 import javax.management.MBeanServerDelegate;
13
14 /**
15  * An alternate builder
16  *
17  * @author <a HREF="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>.
18  * @version $Revision: 1.3 $
19  */

20 public class TestMBeanServerBuilder
21    extends MBeanServerBuilder
22 {
23    public TestMBeanServerBuilder()
24    {
25    }
26
27    public MBeanServer newMBeanServer(String domain, MBeanServer outer, MBeanServerDelegate delegate)
28    {
29       MBeanServer original = super.newMBeanServer(domain, outer, delegate);
30       MBeanServer wrapper = MBeanServerWrapper.getWrapper();
31       MBeanServerWrapper.getHandler(wrapper).server = original;
32       return wrapper;
33    }
34
35    public MBeanServerDelegate newMBeanServerDelegate()
36    {
37       return new TestMBeanServerDelegate();
38    }
39 }
40
Popular Tags