Java Reference
In-Depth Information
we will discuss more connector scenarios that use the Jini connector. The connec-
tor will be made up of three components: an MBean, a Jini service, and a Jini cli-
ent. The following section explores these three components in detail.
9.3.1
Components of the Jini connector
As the previous section mentioned, you need the following three components to
create this connector:
MBean— The MBean allows the connector to be managed through the
MBean server (like the RMI connector and HTML adapter MBeans).
Jini service— The service is created by the MBean. It allows clients to con-
nect to the agent.
Jini client— People use the client class to locate the Jini service from the agent.
The following sections describe the role each component plays in the connector.
Then, we will begin to examine the code.
The MBean
The role of the MBean in the connector is to set up and manage the Jini service.
The MBean gives the agent the capability to control the Jini service, including
setting up its description and deciding when to make the service available for
discovery. The MBean contains a reference to its MBean server, which allows the
Jini service to perform callbacks to the MBean server methods. (You will learn
more about this process when we examine the code.) The MBean component will
be defined by the JINIServerMBean interface and the JINIServer class (which
implements the JINIServerMBean interface).
The Jini service
The Jini service implements methods that correspond to each of the methods
found in the MBean server interface. As you will see in the code to follow, this
process allows the Jini client to forward its method invocations to the MBean
server via the Jini service. The Jini service is defined in a class named JINICon-
nectorImpl , which implements the interface JINIConnector . The interface is a
remote interface used in a Java RMI environment, enabling clients to make
remote invocations on the Jini service.
The connector client
Client-side objects use the Jini client to discover and use the Jini connector ser-
vice (and therefore use the JMX agent). Like the Jini service, it contains methods
Search WWH ::




Custom Search