Package org.ametys.core.mbean
Class AbstractAmetysDynamicMBean
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.mbean.AbstractAmetysDynamicMBean
-
- All Implemented Interfaces:
DynamicMBean,LogEnabled
- Direct Known Subclasses:
CacheUsageMBean,JackrabbitMBean
public abstract class AbstractAmetysDynamicMBean extends AbstractLogEnabled implements DynamicMBean
Abstract class for Ametys Dynamic MBean.
-
-
Field Summary
Fields Modifier and Type Field Description protected MBeanInfo_mBeanInfoThe MBean metadata
-
Constructor Summary
Constructors Constructor Description AbstractAmetysDynamicMBean()AbstractAmetysDynamicMBean basic constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String_fileSize(long size)render a human readable filesizeprotected abstract Object_getAttribute(String attributeName)Get the value of the attribute.ObjectgetAttribute(String attributeName)AttributeListgetAttributes(String[] attributeNames)protected abstract MBeanAttributeInfo[]getMBeanAttributes()Get the definition of the attributes exposed by the MBean.protected MBeanConstructorInfo[]getMBeanConstructorInfo()Get the definition of the constructors exposed by the MBean.protected abstract StringgetMBeanDescription()Get the description of the MBeanMBeanInfogetMBeanInfo()protected abstract StringgetMBeanName()Get the human readable name of the MBean.protected MBeanNotificationInfo[]getMBeanNotificationInfo()Get the definition of the notification exposed by the MBeanprotected MBeanOperationInfo[]getMBeanOperationInfo()Get the definition of the operation methods exposed by the MBeanObjectinvoke(String actionName, Object[] params, String[] signature)voidsetAttribute(Attribute attribute)AttributeListsetAttributes(AttributeList attributes)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_mBeanInfo
protected MBeanInfo _mBeanInfo
The MBean metadata
-
-
Constructor Detail
-
AbstractAmetysDynamicMBean
public AbstractAmetysDynamicMBean()
AbstractAmetysDynamicMBean basic constructor. Generate the MBean info.
-
-
Method Detail
-
getAttribute
public Object getAttribute(String attributeName) throws AttributeNotFoundException
- Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundException
-
_getAttribute
protected abstract Object _getAttribute(String attributeName)
Get the value of the attribute. This method should assume that attributeName is not null. And return null if the name is not recognized- Parameters:
attributeName- the name of the attribute- Returns:
- the value of the attribute
-
getAttributes
public AttributeList getAttributes(String[] attributeNames)
- Specified by:
getAttributesin interfaceDynamicMBean
-
invoke
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
- Specified by:
invokein interfaceDynamicMBean- Throws:
MBeanExceptionReflectionException
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionException
-
setAttributes
public AttributeList setAttributes(AttributeList attributes)
- Specified by:
setAttributesin interfaceDynamicMBean
-
getMBeanInfo
public MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
getMBeanName
protected abstract String getMBeanName()
Get the human readable name of the MBean. This name will be exposed.- Returns:
- the name
-
getMBeanDescription
protected abstract String getMBeanDescription()
Get the description of the MBean- Returns:
- the description
-
getMBeanAttributes
protected abstract MBeanAttributeInfo[] getMBeanAttributes()
Get the definition of the attributes exposed by the MBean.- Returns:
- the attributes information
-
getMBeanConstructorInfo
protected MBeanConstructorInfo[] getMBeanConstructorInfo()
Get the definition of the constructors exposed by the MBean.- Returns:
- the constructors information
-
getMBeanOperationInfo
protected MBeanOperationInfo[] getMBeanOperationInfo()
Get the definition of the operation methods exposed by the MBean- Returns:
- the operations information
-
getMBeanNotificationInfo
protected MBeanNotificationInfo[] getMBeanNotificationInfo()
Get the definition of the notification exposed by the MBean- Returns:
- the notification information
-
-