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:
DynamicMBean,MBeanRegistration,ModelMBean,ModelMBeanNotificationBroadcaster,NotificationBroadcaster,PersistentMBean
- Direct Known Subclasses:
IoFilterMBean,IoServiceMBean,IoSessionMBean
public class ObjectMBean<T> extends Object implements ModelMBean, MBeanRegistration
AModelMBeanwrapper 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
-
-
-
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 Object getSource(ObjectName oname)
Get the monitored object- Parameters:
oname- The object name- Returns:
- The monitored object
-
getAttribute
public final Object getAttribute(String fqan) throws AttributeNotFoundException, MBeanException, ReflectionException
- Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionMBeanExceptionReflectionException
-
setAttribute
public final void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionMBeanExceptionReflectionException
-
invoke
public final Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException
- Specified by:
invokein interfaceDynamicMBean- Throws:
MBeanExceptionReflectionException
-
getSource
public final T getSource()
- Returns:
- The monitored object
-
getServer
public final MBeanServer getServer()
- Returns:
- The MBrean server
-
getName
public final ObjectName getName()
- Returns:
- The monitored object name
-
getMBeanInfo
public final MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
getAttributes
public final AttributeList getAttributes(String[] names)
- Specified by:
getAttributesin interfaceDynamicMBean
-
setAttributes
public final AttributeList setAttributes(AttributeList attributes)
- Specified by:
setAttributesin interfaceDynamicMBean
-
setManagedResource
public final void setManagedResource(Object resource, String type) throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException
- Specified by:
setManagedResourcein interfaceModelMBean- Throws:
InstanceNotFoundExceptionInvalidTargetObjectTypeExceptionMBeanException
-
setModelMBeanInfo
public final void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException
- Specified by:
setModelMBeanInfoin interfaceModelMBean- Throws:
MBeanException
-
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback)
- Specified by:
addAttributeChangeNotificationListenerin interfaceModelMBeanNotificationBroadcaster
-
removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws ListenerNotFoundException
- Specified by:
removeAttributeChangeNotificationListenerin interfaceModelMBeanNotificationBroadcaster- Throws:
ListenerNotFoundException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException
- Specified by:
sendAttributeChangeNotificationin interfaceModelMBeanNotificationBroadcaster- Throws:
MBeanException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException
- Specified by:
sendAttributeChangeNotificationin interfaceModelMBeanNotificationBroadcaster- Throws:
MBeanException
-
sendNotification
public void sendNotification(Notification notification) throws MBeanException
- Specified by:
sendNotificationin interfaceModelMBeanNotificationBroadcaster- Throws:
MBeanException
-
sendNotification
public void sendNotification(String message) throws MBeanException
- Specified by:
sendNotificationin interfaceModelMBeanNotificationBroadcaster- Throws:
MBeanException
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
- Specified by:
addNotificationListenerin interfaceNotificationBroadcaster- Throws:
IllegalArgumentException
-
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfoin interfaceNotificationBroadcaster
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- Specified by:
removeNotificationListenerin interfaceNotificationBroadcaster- Throws:
ListenerNotFoundException
-
load
public void load() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException- Specified by:
loadin interfacePersistentMBean- Throws:
InstanceNotFoundExceptionMBeanExceptionRuntimeOperationsException
-
store
public void store() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException- Specified by:
storein interfacePersistentMBean- Throws:
InstanceNotFoundExceptionMBeanExceptionRuntimeOperationsException
-
preRegister
public final ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
- Specified by:
preRegisterin interfaceMBeanRegistration- Throws:
Exception
-
postRegister
public final void postRegister(Boolean registrationDone)
- Specified by:
postRegisterin interfaceMBeanRegistration
-
preDeregister
public final void preDeregister() throws Exception- Specified by:
preDeregisterin interfaceMBeanRegistration- Throws:
Exception
-
postDeregister
public final void postDeregister()
- Specified by:
postDeregisterin interfaceMBeanRegistration
-
setAttribute0
protected void setAttribute0(String attrName, Object attrValue) throws Exception
- Throws:
Exception
-
invoke0
protected Object invoke0(String name, Object[] params, String[] signature) throws Exception
- Throws:
Exception
-
addExtraAttributes
protected void addExtraAttributes(List<ModelMBeanAttributeInfo> attributes)
-
addExtraOperations
protected void addExtraOperations(List<ModelMBeanOperationInfo> operations)
-
getPropertyEditor
protected PropertyEditor getPropertyEditor(Class<?> type, String attrName, Class<?> attrType)
-
-