org.apache.hivemind.management.mbeans
Class AbstractDynamicMBean

java.lang.Object
  extended by org.apache.hivemind.management.mbeans.AbstractDynamicMBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration
Direct Known Subclasses:
LoggerMBean, LogManagementMBean, PerformanceMonitorMBean

public abstract class AbstractDynamicMBean
extends java.lang.Object
implements javax.management.MBeanRegistration, javax.management.DynamicMBean

Ancestor for MBeans. Eases implementation of the DynamicMBean interface. Provides empty method implementations and implements getAttributes(String[]) and setAttributes(AttributeList)

Author:
Achim Huegen

Constructor Summary
AbstractDynamicMBean()
           
 
Method Summary
protected  javax.management.MBeanAttributeInfo[] createMBeanAttributeInfo()
          Provides the info which attributes the MBean has.
protected  javax.management.MBeanConstructorInfo[] createMBeanConstructorInfo()
          Provides the info which constructors MBean has.
protected  javax.management.MBeanNotificationInfo[] createMBeanNotificationInfo()
          Provides the info which notifications the MBean supports.
protected  javax.management.MBeanOperationInfo[] createMBeanOperationInfo()
          Provides the info which operations can be called on the MBean.
 java.lang.Object getAttribute(java.lang.String name)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
          Gets a list of attributes using getAttribute(String)
protected  java.lang.String getMBeanClassName()
           
protected  java.lang.String getMBeanDescription()
           
 javax.management.MBeanInfo getMBeanInfo()
           
protected  javax.management.MBeanServer getMBeanServer()
           
 java.lang.Object invoke(java.lang.String method, java.lang.Object[] arguments, java.lang.String[] params)
           
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer mbeanserver, javax.management.ObjectName objectname)
           
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
protected  void setMBeanInfo(javax.management.MBeanInfo info)
          Sets the MBeanInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDynamicMBean

public AbstractDynamicMBean()
Method Detail

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean
See Also:
DynamicMBean.getMBeanInfo()

setMBeanInfo

protected void setMBeanInfo(javax.management.MBeanInfo info)
Sets the MBeanInfo

Parameters:
info - the info

createMBeanAttributeInfo

protected javax.management.MBeanAttributeInfo[] createMBeanAttributeInfo()
Provides the info which attributes the MBean has. Should be overwritten by the descendants


createMBeanConstructorInfo

protected javax.management.MBeanConstructorInfo[] createMBeanConstructorInfo()
Provides the info which constructors MBean has. Should be overwritten by the descendants


createMBeanOperationInfo

protected javax.management.MBeanOperationInfo[] createMBeanOperationInfo()
Provides the info which operations can be called on the MBean. Should be overwritten by the descendants


createMBeanNotificationInfo

protected javax.management.MBeanNotificationInfo[] createMBeanNotificationInfo()
Provides the info which notifications the MBean supports. Should be overwritten by the descendants


getMBeanClassName

protected java.lang.String getMBeanClassName()

getMBeanDescription

protected java.lang.String getMBeanDescription()
Returns:
Textual description of the MBean

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
See Also:
DynamicMBean.getAttribute(java.lang.String)

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
See Also:
DynamicMBean.setAttribute(javax.management.Attribute)

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Gets a list of attributes using getAttribute(String)

Specified by:
getAttributes in interface javax.management.DynamicMBean
See Also:
DynamicMBean.getAttributes(java.lang.String[])

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Specified by:
setAttributes in interface javax.management.DynamicMBean
See Also:
DynamicMBean.setAttributes(javax.management.AttributeList)

invoke

public java.lang.Object invoke(java.lang.String method,
                               java.lang.Object[] arguments,
                               java.lang.String[] params)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.DynamicMBean
Throws:
javax.management.MBeanException
javax.management.ReflectionException
See Also:
DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer mbeanserver,
                                               javax.management.ObjectName objectname)
Specified by:
preRegister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

getMBeanServer

protected javax.management.MBeanServer getMBeanServer()