Package com.jrockit.mc.rjmx

This package contains the core RJMX API.

See:
          Description

Interface Summary
IConnectionDescriptor An IConnectionDescriptor describes a connection.
IConnectionHandle An IConnectionHandle is a handle to an active connection.
IConnectionHandleFilter Interface to filter IConnectionHandles.
IConnectionHandleStateListener Listener for changes to the state of an IConnectionHandle
IConnectionManager Class that manages the life cycle for connections and services.
 

Class Summary
ConnectionDescriptorToolkit Toolkit for extracting and caching data from IConnectionDescriptor
ConnectionHandleEvent Event that signals changes to the provider.
ConnectionHandleEvent.State Class for the connection state.
ConnectionManager This is the default implementation of the IConnectionManager.
DescriptorRepository The repository for IConnectionDescriptors.
JMXDescriptorBuilder This class hides the complexities of building a default JMX ConnectionDescriptor in a type safe way.
 

Exception Summary
ConnectionException This exception is thrown when an IO related problem occurs.
 

Package com.jrockit.mc.rjmx Description

This package contains the core RJMX API. RJMX is an extension built upon JMX to handle pluggable JMX based services. The default services encompass a a compatibility layer, an attribute subscription engine, a notification engine and others.

Example usage:

                DefaultConnectionManager manager = new DefaultConnectionManager();
                JMXDescriptorBuilder builder = new JMXDescriptorBuilder();
                IConnectionDescriptor descriptor = builder.hostName("localhost").port(0).build();
                IConnectionHandle handle = manager.connect(descriptor);
                
                ISubscriptionService service = (ISubscriptionService) handle.getService(ISubscriptionService.class);
                AttributeDescriptor attribute = new AttributeDescriptor("java.lang:type=Threading", "ThreadCount");
                service.addAttributeValueListener(attribute, new IAttributeValueListener() {
                        public void valueChanged(AttributeValueEvent event) {
                                System.out.println(event.getValue());
                        }                       
                });
                IAttributeSubscription subscription = service.getAttributeSubscription(attribute);
                subscription.setUpdatePolicy(PolicyFactory.createSimpleUpdatePolicy(1500));
                manager.disconnect(handle);

Notable interfaces and starting points:

IConnectionDescriptor represents an end point of communication. There are various implementations available throughout JRockit Mission Control, but the most commonly used one is the simple DefaultJMXConnectionDescriptor. Notice that the subscription thread is a deamon thread - if trying the example above in a main, add a Thread.sleep(10000) before the disconnect.

An IConnectionManager helps establish a connection for an IConnectionDescriptor. The most commonly used one is the DefaultConnectionManager

The ConnectionDescriptorToolkit is helpful for deriving information from an IConnectionDescriptor.



Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.