All connector clients implement the RemoteMBeanServer interface in order to expose the methods needed to access and manage the MBeans in a remote agent. This interface allows all management operations that would be possible directly in the agent application. In fact, the methods of the connector client for accessing MBeans remotely have exactly the same name and signature as their equivalent methods in the MBeanServer interface.
The following methods are defined identically in both the MBeanServer and the RemoteMBeanServer interfaces:
Table 8-1 The Set of Shared Methods[diams ] void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, java.lang.Object handback) |
ObjectInstance | createMBean(*) - All four overloaded forms of this method |
[diams ] java.lang.Object | getAttribute(ObjectName name, java.lang.String attribute) |
[diams ] AttributeList | getAttributes(ObjectName name, java.lang.String[] attributes) |
java.lang.String | getDefaultDomain() |
java.lang.Integer | getMBeanCount() |
[diams ] MBeanInfo | getMBeanInfo(ObjectName name) |
ObjectInstance | getObjectInstance(ObjectName name) |
[diams ] java.lang.Object | invoke(ObjectName name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature) |
boolean | isInstanceOf(ObjectName name, java.lang.String className) |
boolean | isRegistered(ObjectName name) |
java.util.Set | queryMBeans(ObjectName name, QueryExp query) |
java.util.Set | queryNames(ObjectName name, QueryExp query) |
[diams ] void | removeNotificationListener(ObjectName name, NotificationListener listener) |
[diams ] void | setAttribute(ObjectName name, Attribute attribute) |
[diams ] AttributeList | setAttributes(ObjectName name, AttributeList attributes) |
[diams ] void | unregisterMBean(ObjectName name) |
[diams ] These methods are defined in the ProxyHandler interface; see the next topic: "Local and Remote Proxies".
Components of a management application which rely solely on this common subset of methods may be instantiated in either the agent or the manager application. Such components are location independent and may be reused either locally or remotely as managemement solutions evolve. This symmetry also allows the design of advanced management architectures where functionality may be deployed either in the agent or in the manager, depending on runtime conditions.
The other, unshared methods of the RemoteMBeanServer interface are used to establish and monitor the connection. In the following section, we will establish a connection and access MBeans directly through the connector client. In "The Heartbeat Mechanism", we will see how to monitor a connection and detect when it is lost.