Note that even though this base class implements a number of interfaces, the actual MBean interface supplied by the subclass construction-time determines which of these is actually exposed in the MBeanInfo.
A subclass should generally not implement get/setAttribute(s) as these calls are processed in this base class--
If a subclass implements a getter or setter Method it will be invoked automatically. If there is no getter or setter Method, then the getAttributeManually() or setAttributeManually() methods will be invoked; the subclass should implement these methods instead.
Method invocation is also handled automatically. If a Method cannot be found, the invokeManually() method is called; the subclass should implement this method.
Note that various optimizations are possible, but not implemented. These include caching Methods for each Attribute and for operations as well. Careful testing should be done before complicating the code with such optimizations.
|
|