Java Reference
In-Depth Information
Figure 11.2
Telephony system managed
with MBeans
one FaxCard MBean registered in a JMX agent. In addition, you will register an
instance of the RoutingTable MBean. This system is described in figure 11.2.
Here lies the problem: disabling a device (phone or fax) takes two steps. First
you have to invoke the disable() method of a particular device MBean, and then
you must invoke the appropriate operation of the RoutingTable MBean to update
the routing table. If you treat this problem as representative of larger or more
complex systems, you can imagine more problematic scenarios. For instance, in
this example only two steps are necessary to perform the disable task, but what if
15 steps were required? To solve this problem, you will define an MBean rela-
tionship that can provide a mechanism to reduce this process to a single step,
essentially allowing you to treat multiple MBeans as a unit.
11.2.3
Defining an external relationship with an MBean
As we described earlier, it would be nice if you could define an MBean that would
behave like a single unit equivalent to the whole system. It would be useful to
expose such an MBean to a management system in an abstracted manner so that
the management system could effectively work with only one object, as opposed
to requiring a manager to deal with each individual MBean.
You will do this by defining a relationship between the PhoneCard and FaxCard
MBeans and the RoutingTable MBean. The relation is represented by an MBean,
and users will only need to interact with it in order to update the phone system.
An external relation is said to be a relation MBean . A relation MBean is registered
as an MBean in an agent, and as a relation in the relation service. Figure 11.3
shows how a relation MBean can help your phone system.
The figure shows a relation MBean that exposes a method, disablePhoneCard
(integer) . In the figure, the method is being invoked with an integer 1 that
Search WWH ::




Custom Search