Java Reference
In-Depth Information
Figure 13.1
Lighting control system with JMX management application
publish messages that provide the added functionality. The lighting controller
does not even know the added functionality exists—the MBean is truly a non-
intrusive solution.
For this example, you want to add functionality to the system when the home-
owner sends the
MOVIELIGHTSOn
command. The
MOVIELIGHTSOn
message sets the
lights to a certain level, and also tells the controller MBean to publish a command
to lower the projection screen and turn on the surround-sound system. Similarly,
upon receipt of the
MOVIELIGHTSOff
command, the MBean raises the projection
screen and turns off the surround-sound system.
Based on figure 13.1, this example needs one MBean, a
JMS
subscriber, and a
JMS
publisher. For debugging capabilities, the
JMS
subscriber will act as the
IR
signal transmitter that sends the final messages to the appropriate devices. For
our purposes, this process will print the messages to standard out. The
JMS
pub-
lisher will send the control messages that simulate the
IR
signal processor that
forwards commands received from the remote control.
The MBean will listen for commands published to the message bus of the
lighting control system. Upon receipt of a recognized command, the MBean will
determine the appropriate macro to execute and issue the messages needed to
complete it. Not only will the MBean perform valuable functions in the home