Previous and current JOnAS versions implement a proprietary remote object that enables connections to the MBean server. This object is registered in JNDI under the name 'RMIConnector_jonasServerName'. It can be accessed using any of the communication protocols support by JOnAS (RMI/JRMP, RMI/IIOP, or JEREMIE - see Section 3.3.1 Choosing the Protocol).
JSR 160 support implies providing standard connector server objects. At start-up, the JMX service creates one or more such objects, depending on the JOnAS configuration (in this case, depending on the content of carol.properties file). To create a client connector, the client side needs to know the URL of the connector server. The following sections present the URLs that can be used by the clients, depending on the protocol chosen.
Currently, JSR-160 connectors can use only the RMI/JRMP and RMI/IIOP protocols.
To use this connector, the jrmp protocol has to be in the carol.protocols list.
The client has to construct a JMXServiceURL using the following String, possibly modified according to the JOnAS specific configuration:
service:jmx:rmi:///jndi/rmi://host:1099/jrmpconnector_jonasServerName |
where host is the host on which is running the JOnAS server to be managed. The port number is given in the carol.properties file.
Then, a JMXConnector has to be created and connected to the connector server using the JMX Remote API.
Hashtable environment = null; JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://host:1099/jrmpconnector_jonas"); JMXConnector connector = JMXConnectorFactory.newJMXConnector(address, environment); connector.connect(environment); |
You can use this connector if the iiop protocol is set in the carol.protocols list.
This is done in the same way as for JRMP, but the String to be used to construct the JMXServiceURL must adhere to the following model: "service:jmx:iiop:///jndi/iiop://host:2000/iiopconnector_jonasServerName"