wt.jmx.core.mbeans
Class Info

java.lang.Object
  extended by wt.jmx.core.StandardMBeanFix
      extended by wt.jmx.core.StandardMBean
          extended by wt.jmx.core.SelfAwareMBean
              extended by wt.jmx.core.mbeans.Info
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, BaseObjectNamed, InfoMBean, SelfEmailingMBean

public abstract class Info
extends SelfAwareMBean
implements InfoMBean

Provides configurable collection of MBean info via getInfoData() routine. Intended for re-use to get collect data for logging summaries, e-mail notifications, etc.

Supported API: true

Extendable: true


Nested Class Summary
static class wt.jmx.core.mbeans.Info.Item
          Simple class representing a triplet of an ObjectName, attribute name, and (optional) display name.
 
Constructor Summary
protected Info(Class mbeanInterface)
          Constructor.
 
Method Summary
protected  void addInfoItem(ObjectName mbeanObjectName, String mbeanAttributeName, String displayName, boolean allowNullObjectName)
          Construct Item object from data specified and append it to list of Items.
 Object getCustomDelegate()
          Return custom delegate as returned by custom delegate factory's getInstance() method or null if no custom delegate has been specified.
 InfoDelegateFactory getCustomDelegateFactory()
          Returns new instance of custom delegate factory if one has been specified, otherwise returns null.
 String getCustomDelegateFactoryClass()
          Return name of custom delegate factory class.
protected  void getInfoData(ObjectName defaultObjectName, List<wt.jmx.core.mbeans.Info.Item> outputItems, List<Collection<ObjectName>> outputObjectNameCollList, List<Object> outputValueList)
          Collects MBean data specified by current set of Item objects.
protected  String[] getInfoItemsPreview(ObjectName defaultObjectName)
          Same as getInfoItemsPreview() but is given a default ObjectName for cases in which an ObjectName was left unspecified.
protected  void insertInfoItem(int idx, ObjectName mbeanObjectName, String mbeanAttributeName, String displayName, boolean allowNullObjectName)
          Construct Item object from data specified and insert it into list of Items.
protected  void setCustomDelegateFactoryClass(String customDelegateFactoryClassname, Class requiredBaseClass)
          Set custom delegate factory class.
 
Methods inherited from class wt.jmx.core.SelfAwareMBean
deregister, destroy, getBaseObjectName, getObjectName, getObjectNameOnPreRegister, getObjectNameSuffix, getOwnerMBean, getSelfAwareMBean, init, isInited, isRegistered, isStarted, postDeregister, postRegister, preDeregister, preRegister, register, register, register, resetObjectName, setOwnerMBean, start, stop
 
Methods inherited from class wt.jmx.core.StandardMBean
cacheMBeanInfo, cacheMBeanInfoInInstance, emailThisMBean, getCachedInstanceMBeanInfo, getCachedMBeanInfo, getDescription, getDescription, getDescription, getDescription, getImpact, getMBeanInfo, getParameterName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
 

Constructor Detail

Info

protected Info(Class mbeanInterface)
        throws NotCompliantMBeanException
Constructor.

Supported API: true

Throws:
NotCompliantMBeanException
Method Detail

getInfoItemsPreview

protected String[] getInfoItemsPreview(ObjectName defaultObjectName)
Same as getInfoItemsPreview() but is given a default ObjectName for cases in which an ObjectName was left unspecified.

Supported API: true


getInfoData

protected void getInfoData(ObjectName defaultObjectName,
                           List<wt.jmx.core.mbeans.Info.Item> outputItems,
                           List<Collection<ObjectName>> outputObjectNameCollList,
                           List<Object> outputValueList)
Collects MBean data specified by current set of Item objects. All lists arguments are for output purposes and are populated with output data in parallel with one another except in cases where 'null' is passed, in which case no data is returned for the given argument (obviously).

Supported API: true

Parameters:
defaultObjectName - ObjectName to use in cases where an Item does not specify an ObjectName
outputItems - populated with current Item objects
outputObjectNameCollList - populated with ObjectNames indicated by each Item appended to outputItems
outputValueList - populated with attribute values corresponding to each Item appended to outputItems

insertInfoItem

protected void insertInfoItem(int idx,
                              ObjectName mbeanObjectName,
                              String mbeanAttributeName,
                              String displayName,
                              boolean allowNullObjectName)
Construct Item object from data specified and insert it into list of Items. If 'allowNullObjectName' is true, then allow 'mbeanObjectName' to be null, otherwise throw a NullPointerException if it is null.

Supported API: true


addInfoItem

protected void addInfoItem(ObjectName mbeanObjectName,
                           String mbeanAttributeName,
                           String displayName,
                           boolean allowNullObjectName)
Construct Item object from data specified and append it to list of Items. If 'allowNullObjectName' is true, then allow 'mbeanObjectName' to be null, otherwise throw a NullPointerException if it is null.

Supported API: true


getCustomDelegateFactoryClass

public String getCustomDelegateFactoryClass()
Return name of custom delegate factory class. [For use by subclasses.]

Supported API: true


setCustomDelegateFactoryClass

protected void setCustomDelegateFactoryClass(String customDelegateFactoryClassname,
                                             Class requiredBaseClass)
                                      throws ClassCastException,
                                             ClassNotFoundException,
                                             IllegalAccessException,
                                             InstantiationException
Set custom delegate factory class. [For use by subclasses.]

Though the factory is set by class name, an instance is created and held for re-use. It is also persisted, assuming the instance can be persisted via XMLEncoder. Finally, if the factory instance extends SelfAwareMBean then it is registered as a MBean child of this MBean and managed as such throughout the lifecycle of this MBean.

Supported API: true

Parameters:
customDelegateFactoryClassname - Name of custom delegate factory class
requiredBaseClass - Class delegate factory class is required to implement or extend
Throws:
ClassCastException
ClassNotFoundException
IllegalAccessException
InstantiationException

getCustomDelegateFactory

public InfoDelegateFactory getCustomDelegateFactory()
Returns new instance of custom delegate factory if one has been specified, otherwise returns null. [For use by subclasses -- and persistence engine.]

Supported API: true


getCustomDelegate

public Object getCustomDelegate()
Return custom delegate as returned by custom delegate factory's getInstance() method or null if no custom delegate has been specified.

Supported API: true