The content of this document is the following:
The target audience for this document is the management application developer or administrator who intends to use standard JMX RMI connectors to access the MBean Server running in a JOnAS server.
Currently, JSR 160 has defined a mandatory connector based on RMI (that supports both RMI/JRMP and RMI/IIOP).
Support for JSR 160 connectors in JOnAS is based on the MX4J JMX implementation.
RMIConnector_jonasServerName
'. It can be
accessed using any of the communication protocols support by JOnAS (RMI/JRMP,
RMI/IIOP, JEREMIE - see Choosing the
Protocol).
JSR 160 support provides standard connector server objects. The JMX
service creates one or several of these objects at start-up, 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 URLs that can be used by the clients, depending on the protocol
chosen.
jrmp
protocol must be in the
carol.protocols
list.
The client must construct a JMXServiceURL
using the following
String
, possibly modified based on the JOnAS-specific
configuration:
service:jmx:rmi:///jndi/rmi://host:1099/jrmpconnector_jonasServerName
where host
is the host on which the JOnAS server to be managed
is running.
Then, a JMXConnector
must 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);
String
being used
to constuct the JMXServiceURL
must adhere to the following
model:
"service:jmx:iiop:///jndi/iiop://host:2000/iiopconnector_jonasServerName"
environment
object initialized as described below.
Hashtable environment = new Hashtable(); environment.put(Context.PROVIDER_URL, "jrmi://host:2001");// use jeremie port number environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.objectweb.carol.jndi.spi.JEREMIEContextWrapperFactory"); environment.put(Context.URL_PKG_PREFIXES, "org.objectweb.jonas.naming"); JMXServiceURL address = new JMXServiceURL("service:jmx:rmi://host:2006/jndi/jeremieconnector_jonas");// use jeremie port number + 5 JMXConnector connector = JMXConnectorFactory.newJMXConnector(address, environment); connector.connect(environment);