Getting Started with the Java Dynamic Management Kit 4.0

Connectors And Protocol Adaptors

Connectors and Protocol Adaptors allows an agent to be accessed and managed by remote custom management applications. These applications could be outside the agent's Java Virtual Machine (JVM). This can be seen in the previous illustration, Figure 1-1 .

Connectors (referred to as adaptors in previous releases) connect the MBean server to management applications and enable MBeans to be instantiated and managed remotely. Every connector provides the same remote management interface, but through a different protocol, which allows remote management applications to connect to agents transparently through the network, regardless of the specific protocol. One or more connector clients can be connected to the MBean server, providing views through specific protocols of the MBeans instantiated and registered with the MBean server. The Java Dynamic Management Kit provides connectors for most major internet protocols (for example, HTTP/TCP and RMI) .

A connector is composed of two parts:

The interface of the remote MBean server is implemented by the connector client. Connectors allow management applications to be transposed onto a manager site, offering the same level of functionality at both the agent and manager side while ensuring seamless, transparent connectivity.

Protocol Adaptors have only a server component and provide connection between a remote management application and an agent, via a specific network protocol. From a manager side, you can view and manage all MBeans registered in the MBean server. This can be achieved by directly accessing the MBean server's interface through a given protocol. For example, a web browser accesses the HTML protocol adaptor directly and, therefore, a client of the HTML protocol adaptor is an HTML browser. Similarly, an SNMP manager accesses the SNMP adaptor directly. Therefore, a client of the SNMP adaptor is an SNMP manager.

In addition, the Java Dynamic Management Kit provides an SNMP toolkit that allows you to generate MBeans that support standard or proprietary MIB's, enabling new Java technology-based agents to be integrated into existing network infrastructures, including most SNMP-based management products.

Connectors and protocol adaptors enable management applications to:

For an agent to be managed remotely, it must include at least one connector or protocol adaptor. However, an agent can include any number of connectors or protocol adaptors, enabling it to be managed remotely by many managers, through different protocols. Proxy MBeans, at the manager side, are used to perform management operations on the corresponding MBeans at the agent side. These MBeans are registered with the MBean server in a manner that is protocol-independent. Neither connectors nor protocol adaptors are automatically started when they are created, which allows you to specify the port number before you start them.

JMX MBean Notification Model

The management interface of an MBean allows an MBean's agent to perform control and configuration operations on the managed resources. The JMX MBean notification model allows MBeans to broadcast management notifications. Management applications and other objects register as listeners with the broadcaster MBean. The JMX MBean notification model enables a listener to register only once and still receive all different notifications that may occur in the broadcast.

Figure 1-2 Remote Notification Mechanism

Graphic

Figure 1-2 illustrates the remote notification mechanism. This can be seen in terms of the Pull mechanism and the Push mechanism.

Adding Notification Listeners

If you want to add a listener of notifications at the agent side you need to call the addNotificationListener method on the MBean server. In this case, the notification will not be forwarded to the connector client. You can also add a listener, addNotificationListeneron the remote MBean server or on proxy MBean A.

There are two ways you can add a listener to the manager side. Firstly, you can call the appropriate addNotificationListener operation on proxy MBean A. This will transmit a call to the agent side and a protocol-dependent, appropriate listener will be created in the MBean server (L1 in Figure 1-2). This is a protocol-dependent, generated listener and is handled by the connector server. It is in charge of sending notifications throughout the network, from the agent side to the manager side, using a specified protocol. Secondly, you can call the addNotificationListener method on the remote MBean server.

The Push Mechanism

You can choose to use the Push Mechanism to push notifications from an agent to a manager. When the connectors run employ the Push Mechanism the connector server forwards the notifications to the connector client as soon as they are emitted by the MBeans. For example, you can register proxy MBean A as a listener of notifications emitted by MBean A. Thus, when MBean A, at the agent side, emits a notification, the HTTP or RMI adaptor forwards this notification to the connector client at the manager side.

The Pull Mechanism

You can choose to use the Pull Mechanism to forward notifications from an agent to a manager. This is useful, for instance, when the agent is unable to connect to a manager. For example, if there is a fire-wall in place between the agent side and the manager side. You can use the Pull Mechanism to pull notifications from the agent side to the manager side. When you create the remote MBean server you need to set the mechanism mode and the pull period. The pull period is the time period between pulls. Pulls occur when the HTTP/RMI connector server at the agent side is instructed by the manager to attempt to pull notifications. Thus, the manager decides when, and how often, it wants to retrieve notifications . For example, the pull frequency could be set to try to get notifications every thirty seconds or every minute.