Package org.apache.mina.integration.jmx
Class ObjectMBean<T>
- java.lang.Object
-
- org.apache.mina.integration.jmx.ObjectMBean<T>
-
- Type Parameters:
T- the type of the managed object
- All Implemented Interfaces:
javax.management.DynamicMBean,javax.management.MBeanRegistration,javax.management.modelmbean.ModelMBean,javax.management.modelmbean.ModelMBeanNotificationBroadcaster,javax.management.NotificationBroadcaster,javax.management.PersistentMBean
- Direct Known Subclasses:
IoFilterMBean,IoServiceMBean,IoSessionMBean
public class ObjectMBean<T> extends java.lang.Object implements javax.management.modelmbean.ModelMBean, javax.management.MBeanRegistrationAModelMBeanwrapper implementation for a POJO.- Author:
- Apache MINA Project
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description ObjectMBean(T source)Creates a new instance with the specified POJO.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name, java.lang.Object handback)protected voidaddExtraAttributes(java.util.List<javax.management.modelmbean.ModelMBeanAttributeInfo> attributes)protected voidaddExtraOperations(java.util.List<javax.management.modelmbean.ModelMBeanOperationInfo> operations)voidaddNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)java.lang.ObjectgetAttribute(java.lang.String fqan)protected java.lang.ObjectgetAttribute0(java.lang.String fqan)javax.management.AttributeListgetAttributes(java.lang.String[] names)protected java.lang.Class<?>getElementType(java.lang.Class<?> type, java.lang.String attrName)protected java.lang.Class<?>getMapKeyType(java.lang.Class<?> type, java.lang.String attrName)protected java.lang.Class<?>getMapValueType(java.lang.Class<?> type, java.lang.String attrName)javax.management.MBeanInfogetMBeanInfo()javax.management.ObjectNamegetName()javax.management.MBeanNotificationInfo[]getNotificationInfo()protected java.beans.PropertyEditorgetPropertyEditor(java.lang.Class<?> type, java.lang.String attrName, java.lang.Class<?> attrType)javax.management.MBeanServergetServer()TgetSource()static java.lang.ObjectgetSource(javax.management.ObjectName oname)Get the monitored objectjava.lang.Objectinvoke(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature)protected java.lang.Objectinvoke0(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature)protected booleanisExpandable(java.lang.Class<?> type, java.lang.String attrName)protected booleanisOperation(java.lang.String methodName, java.lang.Class<?>[] paramTypes)protected booleanisReadable(java.lang.Class<?> type, java.lang.String attrName)protected booleanisWritable(java.lang.Class<?> type, java.lang.String attrName)voidload()voidpostDeregister()voidpostRegister(java.lang.Boolean registrationDone)voidpreDeregister()javax.management.ObjectNamepreRegister(javax.management.MBeanServer server, javax.management.ObjectName name)voidremoveAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name)voidremoveNotificationListener(javax.management.NotificationListener listener)voidsendAttributeChangeNotification(javax.management.AttributeChangeNotification notification)voidsendAttributeChangeNotification(javax.management.Attribute oldValue, javax.management.Attribute newValue)voidsendNotification(java.lang.String message)voidsendNotification(javax.management.Notification notification)voidsetAttribute(javax.management.Attribute attribute)protected voidsetAttribute0(java.lang.String attrName, java.lang.Object attrValue)javax.management.AttributeListsetAttributes(javax.management.AttributeList attributes)voidsetManagedResource(java.lang.Object resource, java.lang.String type)voidsetModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info)voidstore()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ObjectMBean
public ObjectMBean(T source)
Creates a new instance with the specified POJO.- Parameters:
source- The original POJO
-
-
Method Detail
-
getSource
public static java.lang.Object getSource(javax.management.ObjectName oname)
Get the monitored object- Parameters:
oname- The object name- Returns:
- The monitored object
-
getAttribute
public final java.lang.Object getAttribute(java.lang.String fqan) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException- Specified by:
getAttributein interfacejavax.management.DynamicMBean- Throws:
javax.management.AttributeNotFoundExceptionjavax.management.MBeanExceptionjavax.management.ReflectionException
-
setAttribute
public final void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException- Specified by:
setAttributein interfacejavax.management.DynamicMBean- Throws:
javax.management.AttributeNotFoundExceptionjavax.management.MBeanExceptionjavax.management.ReflectionException
-
invoke
public final java.lang.Object invoke(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException- Specified by:
invokein interfacejavax.management.DynamicMBean- Throws:
javax.management.MBeanExceptionjavax.management.ReflectionException
-
getSource
public final T getSource()
- Returns:
- The monitored object
-
getServer
public final javax.management.MBeanServer getServer()
- Returns:
- The MBrean server
-
getName
public final javax.management.ObjectName getName()
- Returns:
- The monitored object name
-
getMBeanInfo
public final javax.management.MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfoin interfacejavax.management.DynamicMBean
-
getAttributes
public final javax.management.AttributeList getAttributes(java.lang.String[] names)
- Specified by:
getAttributesin interfacejavax.management.DynamicMBean
-
setAttributes
public final javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
- Specified by:
setAttributesin interfacejavax.management.DynamicMBean
-
setManagedResource
public final void setManagedResource(java.lang.Object resource, java.lang.String type) throws javax.management.InstanceNotFoundException, javax.management.modelmbean.InvalidTargetObjectTypeException, javax.management.MBeanException- Specified by:
setManagedResourcein interfacejavax.management.modelmbean.ModelMBean- Throws:
javax.management.InstanceNotFoundExceptionjavax.management.modelmbean.InvalidTargetObjectTypeExceptionjavax.management.MBeanException
-
setModelMBeanInfo
public final void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info) throws javax.management.MBeanException- Specified by:
setModelMBeanInfoin interfacejavax.management.modelmbean.ModelMBean- Throws:
javax.management.MBeanException
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name, java.lang.Object handback)- Specified by:
addAttributeChangeNotificationListenerin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster
-
removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(javax.management.NotificationListener listener, java.lang.String name) throws javax.management.ListenerNotFoundException- Specified by:
removeAttributeChangeNotificationListenerin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster- Throws:
javax.management.ListenerNotFoundException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(javax.management.AttributeChangeNotification notification) throws javax.management.MBeanException- Specified by:
sendAttributeChangeNotificationin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster- Throws:
javax.management.MBeanException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(javax.management.Attribute oldValue, javax.management.Attribute newValue) throws javax.management.MBeanException- Specified by:
sendAttributeChangeNotificationin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster- Throws:
javax.management.MBeanException
-
sendNotification
public void sendNotification(javax.management.Notification notification) throws javax.management.MBeanException- Specified by:
sendNotificationin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster- Throws:
javax.management.MBeanException
-
sendNotification
public void sendNotification(java.lang.String message) throws javax.management.MBeanException- Specified by:
sendNotificationin interfacejavax.management.modelmbean.ModelMBeanNotificationBroadcaster- Throws:
javax.management.MBeanException
-
addNotificationListener
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException- Specified by:
addNotificationListenerin interfacejavax.management.NotificationBroadcaster- Throws:
java.lang.IllegalArgumentException
-
getNotificationInfo
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfoin interfacejavax.management.NotificationBroadcaster
-
removeNotificationListener
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException- Specified by:
removeNotificationListenerin interfacejavax.management.NotificationBroadcaster- Throws:
javax.management.ListenerNotFoundException
-
load
public void load() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.RuntimeOperationsException- Specified by:
loadin interfacejavax.management.PersistentMBean- Throws:
javax.management.InstanceNotFoundExceptionjavax.management.MBeanExceptionjavax.management.RuntimeOperationsException
-
store
public void store() throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.RuntimeOperationsException- Specified by:
storein interfacejavax.management.PersistentMBean- Throws:
javax.management.InstanceNotFoundExceptionjavax.management.MBeanExceptionjavax.management.RuntimeOperationsException
-
preRegister
public final javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception- Specified by:
preRegisterin interfacejavax.management.MBeanRegistration- Throws:
java.lang.Exception
-
postRegister
public final void postRegister(java.lang.Boolean registrationDone)
- Specified by:
postRegisterin interfacejavax.management.MBeanRegistration
-
preDeregister
public final void preDeregister() throws java.lang.Exception- Specified by:
preDeregisterin interfacejavax.management.MBeanRegistration- Throws:
java.lang.Exception
-
postDeregister
public final void postDeregister()
- Specified by:
postDeregisterin interfacejavax.management.MBeanRegistration
-
getAttribute0
protected java.lang.Object getAttribute0(java.lang.String fqan) throws java.lang.Exception- Throws:
java.lang.Exception
-
setAttribute0
protected void setAttribute0(java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception- Throws:
java.lang.Exception
-
invoke0
protected java.lang.Object invoke0(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature) throws java.lang.Exception- Throws:
java.lang.Exception
-
isReadable
protected boolean isReadable(java.lang.Class<?> type, java.lang.String attrName)
-
isWritable
protected boolean isWritable(java.lang.Class<?> type, java.lang.String attrName)
-
getElementType
protected java.lang.Class<?> getElementType(java.lang.Class<?> type, java.lang.String attrName)
-
getMapKeyType
protected java.lang.Class<?> getMapKeyType(java.lang.Class<?> type, java.lang.String attrName)
-
getMapValueType
protected java.lang.Class<?> getMapValueType(java.lang.Class<?> type, java.lang.String attrName)
-
isExpandable
protected boolean isExpandable(java.lang.Class<?> type, java.lang.String attrName)
-
isOperation
protected boolean isOperation(java.lang.String methodName, java.lang.Class<?>[] paramTypes)
-
addExtraAttributes
protected void addExtraAttributes(java.util.List<javax.management.modelmbean.ModelMBeanAttributeInfo> attributes)
-
addExtraOperations
protected void addExtraOperations(java.util.List<javax.management.modelmbean.ModelMBeanOperationInfo> operations)
-
getPropertyEditor
protected java.beans.PropertyEditor getPropertyEditor(java.lang.Class<?> type, java.lang.String attrName, java.lang.Class<?> attrType)
-
-