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
AModelMBean
wrapper implementation for a POJO.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description ObjectMBean(T source)
Creates a new instance with the specified POJO.
-
Method Summary
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
-
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:
getAttribute
in interfaceDynamicMBean
- Throws:
AttributeNotFoundException
MBeanException
ReflectionException
-
setAttribute
public final void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
- Specified by:
setAttribute
in interfaceDynamicMBean
- Throws:
AttributeNotFoundException
MBeanException
ReflectionException
-
invoke
public final Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException
- Specified by:
invoke
in interfaceDynamicMBean
- Throws:
MBeanException
ReflectionException
-
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:
getMBeanInfo
in interfaceDynamicMBean
-
getAttributes
public final AttributeList getAttributes(String[] names)
- Specified by:
getAttributes
in interfaceDynamicMBean
-
setAttributes
public final AttributeList setAttributes(AttributeList attributes)
- Specified by:
setAttributes
in interfaceDynamicMBean
-
setManagedResource
public final void setManagedResource(Object resource, String type) throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException
- Specified by:
setManagedResource
in interfaceModelMBean
- Throws:
InstanceNotFoundException
InvalidTargetObjectTypeException
MBeanException
-
setModelMBeanInfo
public final void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException
- Specified by:
setModelMBeanInfo
in interfaceModelMBean
- Throws:
MBeanException
-
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback)
- Specified by:
addAttributeChangeNotificationListener
in interfaceModelMBeanNotificationBroadcaster
-
removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws ListenerNotFoundException
- Specified by:
removeAttributeChangeNotificationListener
in interfaceModelMBeanNotificationBroadcaster
- Throws:
ListenerNotFoundException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException
- Specified by:
sendAttributeChangeNotification
in interfaceModelMBeanNotificationBroadcaster
- Throws:
MBeanException
-
sendAttributeChangeNotification
public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException
- Specified by:
sendAttributeChangeNotification
in interfaceModelMBeanNotificationBroadcaster
- Throws:
MBeanException
-
sendNotification
public void sendNotification(Notification notification) throws MBeanException
- Specified by:
sendNotification
in interfaceModelMBeanNotificationBroadcaster
- Throws:
MBeanException
-
sendNotification
public void sendNotification(String message) throws MBeanException
- Specified by:
sendNotification
in interfaceModelMBeanNotificationBroadcaster
- Throws:
MBeanException
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
- Specified by:
addNotificationListener
in interfaceNotificationBroadcaster
- Throws:
IllegalArgumentException
-
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfo
in interfaceNotificationBroadcaster
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interfaceNotificationBroadcaster
- Throws:
ListenerNotFoundException
-
load
public void load() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException
- Specified by:
load
in interfacePersistentMBean
- Throws:
InstanceNotFoundException
MBeanException
RuntimeOperationsException
-
store
public void store() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException
- Specified by:
store
in interfacePersistentMBean
- Throws:
InstanceNotFoundException
MBeanException
RuntimeOperationsException
-
preRegister
public final ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
- Specified by:
preRegister
in interfaceMBeanRegistration
- Throws:
Exception
-
postRegister
public final void postRegister(Boolean registrationDone)
- Specified by:
postRegister
in interfaceMBeanRegistration
-
preDeregister
public final void preDeregister() throws Exception
- Specified by:
preDeregister
in interfaceMBeanRegistration
- Throws:
Exception
-
postDeregister
public final void postDeregister()
- Specified by:
postDeregister
in 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)
-
-