1.3 Creating a JMX Connection
Use the following JMX Service URL to create a JMX connection:
service:jmx:rmi://rmihost:rmiport/jndi/rmi://rmihost:rmiport/server
The rmihost and rmiport are the host and port configured in tlisten by the –j option. After configuring this option, a JMX Agent runs in a JVM started in the tlisten process by JNI technology.
The "jmx.remote.credentials" must be a String array which is parsed in the following order:
| Order | Tuxedo Authentication and Authorization Data | Comments |
|---|---|---|
| 0 | User Name |
Optional. Required when the Tuxedo security or JMX security is enabled; otherwise leave it blank. If the Tuxedo security is enabled, it is the Tuxedo username; If JMX security is enabled, it is the JMX user name added by jmxaaacfg.
|
| 1 | Password
|
Optional. Required if the Tuxedo security or JMX security is enabled; otherwise leave it blank. If the password is not null, it must be encrypted using the oracle.tuxedo.jmx.tux.utility.Encryption.encrypt() method in $TUXDIR/jmx/tmjmx_tux.jar
|
| 2 | Application Password |
Optional. Required if the Tuxedo security is enabled; otherwise leave it blank. If the application password is not null, it must be encrypted using the oracle.tuxedo.jmx.tux.utility.Encryption.encrypt() method in $TUXDIR/jmx/tmjmx_tux.jar
|
| 3 | DOMAINID |
Optional. Required in the case of multiple domains within one tlisten. |
| 4 | IPCKEY |
Optional. Required in the case of multiple domains within one tlisten. |
| 5 | TUXCONFIG |
Optional. Required after the tlisten restarts. |
| 6 | NONTUXAUTH |
Optional. Add "NONTUXAUTH" in the list of "jmx.remote.credentials" , the Tuxedo authentication is not taken place when connecting JMX server. In this case, the invocation of the JMX operations which requires Tuxedo authentication will fail.
|
Following is an example of creating JMX connector.
Creating JMX Connector
String[] credentials = new String[] { username, password, appPassword };
Map<String, Object> env = new HashMap<String, Object>();
env.put("jmx.remote.credentials", credentials);
// Create an RMI connector client and
// connect it to the RMI connector server;
JMXServiceURL url = new JMXServiceURL(String.format(
"service:jmx:rmi://%s:%s/jndi/rmi://%s:%s/server", host, port,
host, port));
JMXConnector jmxc = JMXConnectorFactory.connect(url, env);Parent topic: Oracle Tuxedo JMX Interface