javax.management.remote.rmi


1. Registering and Exposing an MBean Remotely

import javax.management.ObjectName;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.rmi.RMIConnectorServer;

// Create an MBean to expose remote methods
ObjectName mBeanName = new ObjectName("com.example:type=MyMBean");

// Create an RMI connector server
RMIConnectorServer server = JMXConnectorServerFactory.newRMIConnectorServer(
        new JMXConnectorServer.RMIConfiguration(
                // Set the RMI port
                Integer.valueOf(9999),
                // Enable authentication
                true,
                // Set authentication credentials
                "admin",
                "password"));

// Register the MBean with the RMI connector server
server.getMBeanServer().registerMBean(mBean, mBeanName);

// Start the RMI connector server
server.start();

2. Connecting to a Remote MBean Server

3. Invoking Remote MBean Methods

4. Monitoring Remote MBeans with Event Listeners

5. Creating and Registering MBeans Remotely

6. Unregistering MBeans Remotely

7. Setting MBean Attributes Remotely

8. Getting MBean Attributes Remotely

9. Querying MBeans Remotely

10. Monitoring Remote MBeans with Instrumentation

11. Remote MBean Server Monitoring

12. Remote MBean Server Shutdown

13. Remote MBean Server Configuration