org.apache.mina.integration.jmx
Class ObjectMBean<T>

java.lang.Object
  extended by 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

A ModelMBean wrapper implementation for a POJO.

Version:
$Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (jeu, 26 jun 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Field Summary
protected  Logger logger
           
 
Constructor Summary
ObjectMBean(T source)
          Creates a new instance with the specified POJO.
 
Method Summary
 void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback)
           
protected  void addExtraAttributes(List<ModelMBeanAttributeInfo> attributes)
           
protected  void addExtraOperations(List<ModelMBeanOperationInfo> operations)
           
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 Object getAttribute(String fqan)
           
protected  Object getAttribute0(String fqan)
           
 AttributeList getAttributes(String[] names)
           
protected  Class<?> getElementType(Class<?> type, String attrName)
           
protected  Class<?> getMapKeyType(Class<?> type, String attrName)
           
protected  Class<?> getMapValueType(Class<?> type, String attrName)
           
 MBeanInfo getMBeanInfo()
           
 ObjectName getName()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
protected  PropertyEditor getPropertyEditor(Class<?> type, String attrName, Class<?> attrType)
           
 MBeanServer getServer()
           
 T getSource()
           
static Object getSource(ObjectName oname)
           
 Object invoke(String name, Object[] params, String[] signature)
           
protected  Object invoke0(String name, Object[] params, String[] signature)
           
protected  boolean isExpandable(Class<?> type, String attrName)
           
protected  boolean isOperation(String methodName, Class<?>[] paramTypes)
           
protected  boolean isReadable(Class<?> type, String attrName)
           
protected  boolean isWritable(Class<?> type, String attrName)
           
 void load()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
 void removeAttributeChangeNotificationListener(NotificationListener listener, String name)
           
 void removeNotificationListener(NotificationListener listener)
           
 void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue)
           
 void sendAttributeChangeNotification(AttributeChangeNotification notification)
           
 void sendNotification(Notification notification)
           
 void sendNotification(String message)
           
 void setAttribute(Attribute attribute)
           
protected  void setAttribute0(String attrName, Object attrValue)
           
 AttributeList setAttributes(AttributeList attributes)
           
 void setManagedResource(Object resource, String type)
           
 void setModelMBeanInfo(ModelMBeanInfo info)
           
 void store()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

ObjectMBean

public ObjectMBean(T source)
Creates a new instance with the specified POJO.

Method Detail

getSource

public static Object getSource(ObjectName oname)

getAttribute

public final Object getAttribute(String fqan)
                          throws AttributeNotFoundException,
                                 MBeanException,
                                 ReflectionException
Specified by:
getAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

setAttribute

public final void setAttribute(Attribute attribute)
                        throws AttributeNotFoundException,
                               MBeanException,
                               ReflectionException
Specified by:
setAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

invoke

public final Object invoke(String name,
                           Object[] params,
                           String[] signature)
                    throws MBeanException,
                           ReflectionException
Specified by:
invoke in interface DynamicMBean
Throws:
MBeanException
ReflectionException

getSource

public final T getSource()

getServer

public final MBeanServer getServer()

getName

public final ObjectName getName()

getMBeanInfo

public final MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean

getAttributes

public final AttributeList getAttributes(String[] names)
Specified by:
getAttributes in interface DynamicMBean

setAttributes

public final AttributeList setAttributes(AttributeList attributes)
Specified by:
setAttributes in interface DynamicMBean

setManagedResource

public final void setManagedResource(Object resource,
                                     String type)
                              throws InstanceNotFoundException,
                                     InvalidTargetObjectTypeException,
                                     MBeanException
Specified by:
setManagedResource in interface ModelMBean
Throws:
InstanceNotFoundException
InvalidTargetObjectTypeException
MBeanException

setModelMBeanInfo

public final void setModelMBeanInfo(ModelMBeanInfo info)
                             throws MBeanException
Specified by:
setModelMBeanInfo in interface ModelMBean
Throws:
MBeanException

toString

public final String toString()
Overrides:
toString in class Object

addAttributeChangeNotificationListener

public void addAttributeChangeNotificationListener(NotificationListener listener,
                                                   String name,
                                                   Object handback)
Specified by:
addAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcaster

removeAttributeChangeNotificationListener

public void removeAttributeChangeNotificationListener(NotificationListener listener,
                                                      String name)
                                               throws ListenerNotFoundException
Specified by:
removeAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcaster
Throws:
ListenerNotFoundException

sendAttributeChangeNotification

public void sendAttributeChangeNotification(AttributeChangeNotification notification)
                                     throws MBeanException
Specified by:
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcaster
Throws:
MBeanException

sendAttributeChangeNotification

public void sendAttributeChangeNotification(Attribute oldValue,
                                            Attribute newValue)
                                     throws MBeanException
Specified by:
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcaster
Throws:
MBeanException

sendNotification

public void sendNotification(Notification notification)
                      throws MBeanException
Specified by:
sendNotification in interface ModelMBeanNotificationBroadcaster
Throws:
MBeanException

sendNotification

public void sendNotification(String message)
                      throws MBeanException
Specified by:
sendNotification in interface ModelMBeanNotificationBroadcaster
Throws:
MBeanException

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws IllegalArgumentException
Specified by:
addNotificationListener in interface NotificationBroadcaster
Throws:
IllegalArgumentException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

load

public void load()
          throws InstanceNotFoundException,
                 MBeanException,
                 RuntimeOperationsException
Specified by:
load in interface PersistentMBean
Throws:
InstanceNotFoundException
MBeanException
RuntimeOperationsException

store

public void store()
           throws InstanceNotFoundException,
                  MBeanException,
                  RuntimeOperationsException
Specified by:
store in interface PersistentMBean
Throws:
InstanceNotFoundException
MBeanException
RuntimeOperationsException

preRegister

public final ObjectName preRegister(MBeanServer server,
                                    ObjectName name)
                             throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public final void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public final void preDeregister()
                         throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public final void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

getAttribute0

protected Object getAttribute0(String fqan)
                        throws Exception
Throws:
Exception

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

isReadable

protected boolean isReadable(Class<?> type,
                             String attrName)

isWritable

protected boolean isWritable(Class<?> type,
                             String attrName)

getElementType

protected Class<?> getElementType(Class<?> type,
                                  String attrName)

getMapKeyType

protected Class<?> getMapKeyType(Class<?> type,
                                 String attrName)

getMapValueType

protected Class<?> getMapValueType(Class<?> type,
                                   String attrName)

isExpandable

protected boolean isExpandable(Class<?> type,
                               String attrName)

isOperation

protected boolean isOperation(String methodName,
                              Class<?>[] paramTypes)

addExtraAttributes

protected void addExtraAttributes(List<ModelMBeanAttributeInfo> attributes)

addExtraOperations

protected void addExtraOperations(List<ModelMBeanOperationInfo> operations)

getPropertyEditor

protected PropertyEditor getPropertyEditor(Class<?> type,
                                           String attrName,
                                           Class<?> attrType)


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.