01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package test.javax.management.remote.rmi;
10:
11: import javax.management.MBeanServer;
12: import javax.management.remote.JMXConnector;
13: import javax.management.remote.JMXConnectorFactory;
14: import javax.management.remote.JMXConnectorServer;
15: import javax.management.remote.JMXConnectorServerFactory;
16: import javax.management.remote.JMXServiceURL;
17:
18: import test.javax.management.MultiThreadMBeanServerTest;
19:
20: /**
21: * @version $Revision: 1.3 $
22: */
23: public class RMIJRMPMultiThreadMBeanServerConnectionTest extends
24: MultiThreadMBeanServerTest {
25: private JMXConnectorServer connectorServer;
26:
27: public RMIJRMPMultiThreadMBeanServerConnectionTest(String s) {
28: super (s);
29: }
30:
31: protected void setUp() throws Exception {
32: MBeanServer server = newMBeanServer();
33: JMXServiceURL url = new JMXServiceURL("rmi", "localhost", 0);
34: connectorServer = JMXConnectorServerFactory
35: .newJMXConnectorServer(url, null, server);
36: connectorServer.start();
37: sleep(1000);
38:
39: JMXConnector connector = JMXConnectorFactory
40: .connect(connectorServer.getAddress());
41: this .server = connector.getMBeanServerConnection();
42: }
43:
44: protected void tearDown() throws Exception {
45: super .tearDown();
46: connectorServer.stop();
47: sleep(1000);
48: }
49: }
|