Java Reference
In-Depth Information
Table 4.1 The exposed attributes and operations of the PrinterMBean interface.
Attributes are defined by the getter and setter methods. The operations are the
methods that are not attributes.
Declared method
Exposed part of management interface
getPrintJobCount() Attribute PrintJobCount with read access
getPrinterName() Attribute PrinterName with read access
getPrintQuality() Attribute PrintQuality with read access
setPrintQuality( int value ) Attribute PrintQuality with write access
Operation cancelPrintJobs
cancelPrintJobs()
Operation performSelfCheck
performSelfCheck()
The two parts of a management interface that an MBean interface does not
describe are the public constructors and optional notifications. Notifications are
described by a separate interface, NotificationBroadcaster , and will be covered
later (in chapter 6). Public constructors are found in the class that implements
the MBean interface and are discovered by introspection at the agent level.
The MBean interface makes an MBean a Standard MBean. It follows the
normal interface rules of the Java language with respect to inheritance and so
forth. However, depending on the level at which the interface is implemented, a
different management interface may be created for an MBean. The following
section describes the different inheritance schemes you can use to create a Stan-
dard MBean.
4.3 Standard MBean inheritance patterns
As we've repeatedly mentioned, a Standard MBean is an MBean that implements
its own MBean interface. However, you need to be able to recognize the design
patterns associated with a Standard MBean. Most likely you have experience with
Java, and you understand the ability of Java classes and interfaces to extend
other classes and interfaces. However, what effect does subclassing have on the
management interface of a Standard MBean?
This section breaks down all the possible inheritance scenarios and explains
how each affects the management interface of a Standard MBean. The inherit-
ance patterns are presented in this topic because they can affect the manage-
ment interface you are trying to create.
Search WWH ::




Custom Search