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
_mBeanInfo
The 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.Object
getAttribute(String attributeName)
AttributeList
getAttributes(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 String
getMBeanDescription()
Get the description of the MBeanMBeanInfo
getMBeanInfo()
protected abstract String
getMBeanName()
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 MBeanObject
invoke(String actionName, Object[] params, String[] signature)
void
setAttribute(Attribute attribute)
AttributeList
setAttributes(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:
getAttribute
in 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:
getAttributes
in interfaceDynamicMBean
-
invoke
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
- Specified by:
invoke
in interfaceDynamicMBean
- Throws:
MBeanException
ReflectionException
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
- Specified by:
setAttribute
in interfaceDynamicMBean
- Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
-
setAttributes
public AttributeList setAttributes(AttributeList attributes)
- Specified by:
setAttributes
in interfaceDynamicMBean
-
getMBeanInfo
public MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfo
in 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
-
-