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.MBeanRegistration
A ModelMBean
wrapper implementation for a POJO.
- Author:
- Apache MINA Project
Field Summary |
protected static org.slf4j.Logger |
LOGGER
|
Constructor Summary |
ObjectMBean(T source)
Creates a new instance with the specified POJO. |
Method Summary |
void |
addAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name,
java.lang.Object handback)
|
protected void |
addExtraAttributes(java.util.List<javax.management.modelmbean.ModelMBeanAttributeInfo> attributes)
|
protected void |
addExtraOperations(java.util.List<javax.management.modelmbean.ModelMBeanOperationInfo> operations)
|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
|
java.lang.Object |
getAttribute(java.lang.String fqan)
|
protected java.lang.Object |
getAttribute0(java.lang.String fqan)
|
javax.management.AttributeList |
getAttributes(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.MBeanInfo |
getMBeanInfo()
|
javax.management.ObjectName |
getName()
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
protected java.beans.PropertyEditor |
getPropertyEditor(java.lang.Class<?> type,
java.lang.String attrName,
java.lang.Class<?> attrType)
|
javax.management.MBeanServer |
getServer()
|
T |
getSource()
|
static java.lang.Object |
getSource(javax.management.ObjectName oname)
|
java.lang.Object |
invoke(java.lang.String name,
java.lang.Object[] params,
java.lang.String[] signature)
|
protected java.lang.Object |
invoke0(java.lang.String name,
java.lang.Object[] params,
java.lang.String[] signature)
|
protected boolean |
isExpandable(java.lang.Class<?> type,
java.lang.String attrName)
|
protected boolean |
isOperation(java.lang.String methodName,
java.lang.Class<?>[] paramTypes)
|
protected boolean |
isReadable(java.lang.Class<?> type,
java.lang.String attrName)
|
protected boolean |
isWritable(java.lang.Class<?> type,
java.lang.String attrName)
|
void |
load()
|
void |
postDeregister()
|
void |
postRegister(java.lang.Boolean registrationDone)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
void |
removeAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name)
|
void |
removeNotificationListener(javax.management.NotificationListener listener)
|
void |
sendAttributeChangeNotification(javax.management.Attribute oldValue,
javax.management.Attribute newValue)
|
void |
sendAttributeChangeNotification(javax.management.AttributeChangeNotification notification)
|
void |
sendNotification(javax.management.Notification notification)
|
void |
sendNotification(java.lang.String message)
|
void |
setAttribute(javax.management.Attribute attribute)
|
protected void |
setAttribute0(java.lang.String attrName,
java.lang.Object attrValue)
|
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
|
void |
setManagedResource(java.lang.Object resource,
java.lang.String type)
|
void |
setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info)
|
void |
store()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LOGGER
protected static final org.slf4j.Logger LOGGER
ObjectMBean
public ObjectMBean(T source)
- Creates a new instance with the specified POJO.
getSource
public static java.lang.Object getSource(javax.management.ObjectName oname)
getAttribute
public final java.lang.Object getAttribute(java.lang.String fqan)
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
setAttribute
public final void setAttribute(javax.management.Attribute attribute)
throws javax.management.AttributeNotFoundException,
javax.management.MBeanException,
javax.management.ReflectionException
- Specified by:
setAttribute
in interface javax.management.DynamicMBean
- Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.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:
invoke
in interface javax.management.DynamicMBean
- Throws:
javax.management.MBeanException
javax.management.ReflectionException
getSource
public final T getSource()
getServer
public final javax.management.MBeanServer getServer()
getName
public final javax.management.ObjectName getName()
getMBeanInfo
public final javax.management.MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfo
in interface javax.management.DynamicMBean
getAttributes
public final javax.management.AttributeList getAttributes(java.lang.String[] names)
- Specified by:
getAttributes
in interface javax.management.DynamicMBean
setAttributes
public final javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
- Specified by:
setAttributes
in interface javax.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:
setManagedResource
in interface javax.management.modelmbean.ModelMBean
- Throws:
javax.management.InstanceNotFoundException
javax.management.modelmbean.InvalidTargetObjectTypeException
javax.management.MBeanException
setModelMBeanInfo
public final void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo info)
throws javax.management.MBeanException
- Specified by:
setModelMBeanInfo
in interface javax.management.modelmbean.ModelMBean
- Throws:
javax.management.MBeanException
toString
public final java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name,
java.lang.Object handback)
- Specified by:
addAttributeChangeNotificationListener
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(javax.management.NotificationListener listener,
java.lang.String name)
throws javax.management.ListenerNotFoundException
- Specified by:
removeAttributeChangeNotificationListener
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
- Throws:
javax.management.ListenerNotFoundException
sendAttributeChangeNotification
public void sendAttributeChangeNotification(javax.management.AttributeChangeNotification notification)
throws javax.management.MBeanException
- Specified by:
sendAttributeChangeNotification
in interface javax.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:
sendAttributeChangeNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
- Throws:
javax.management.MBeanException
sendNotification
public void sendNotification(javax.management.Notification notification)
throws javax.management.MBeanException
- Specified by:
sendNotification
in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
- Throws:
javax.management.MBeanException
sendNotification
public void sendNotification(java.lang.String message)
throws javax.management.MBeanException
- Specified by:
sendNotification
in interface javax.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:
addNotificationListener
in interface javax.management.NotificationBroadcaster
- Throws:
java.lang.IllegalArgumentException
getNotificationInfo
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfo
in interface javax.management.NotificationBroadcaster
removeNotificationListener
public void removeNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface javax.management.NotificationBroadcaster
- Throws:
javax.management.ListenerNotFoundException
load
public void load()
throws javax.management.InstanceNotFoundException,
javax.management.MBeanException,
javax.management.RuntimeOperationsException
- Specified by:
load
in interface javax.management.PersistentMBean
- Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.RuntimeOperationsException
store
public void store()
throws javax.management.InstanceNotFoundException,
javax.management.MBeanException,
javax.management.RuntimeOperationsException
- Specified by:
store
in interface javax.management.PersistentMBean
- Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.RuntimeOperationsException
preRegister
public final javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
- Specified by:
preRegister
in interface javax.management.MBeanRegistration
- Throws:
java.lang.Exception
postRegister
public final void postRegister(java.lang.Boolean registrationDone)
- Specified by:
postRegister
in interface javax.management.MBeanRegistration
preDeregister
public final void preDeregister()
throws java.lang.Exception
- Specified by:
preDeregister
in interface javax.management.MBeanRegistration
- Throws:
java.lang.Exception
postDeregister
public final void postDeregister()
- Specified by:
postDeregister
in interface javax.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)