org.apache.servicemix.jbi.management
Class BaseStandardMBean

java.lang.Object
  extended by javax.management.StandardMBean
      extended by org.apache.servicemix.jbi.management.BaseStandardMBean
All Implemented Interfaces:
PropertyChangeListener, EventListener, DynamicMBean, MBeanRegistration, ModelMBeanNotificationBroadcaster, NotificationBroadcaster

public class BaseStandardMBean
extends StandardMBean
implements ModelMBeanNotificationBroadcaster, MBeanRegistration, PropertyChangeListener

An MBean wrapper for an Existing Object

Version:
$Revision: 2153 $

Field Summary
protected  ExecutorService executorService
           
 
Constructor Summary
BaseStandardMBean(Object object, Class interfaceMBean, String description, MBeanAttributeInfo[] attrs, MBeanOperationInfo[] ops, ExecutorService executorService)
          Constructor
 
Method Summary
 void addAttributeChangeNotificationListener(NotificationListener l, String attrName, Object handback)
           
 void addNotificationListener(NotificationListener l, NotificationFilter filter, Object handle)
           
 Object getAttribute(String name)
          Get the Value of an Attribute
 AttributeList getAttributes(String[] attributes)
           
 MBeanServer getBeanServer()
          Retrieve the MBeanServer - set after registration
 MBeanInfo getMBeanInfo()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 ObjectName getObjectName()
          Retrieve ObjectName of the MBean - set after registration
 Object invoke(String name, Object[] params, String[] signature)
          Invoke an operation
 void postDeregister()
          Called after removal from the MBeanServer
 void postRegister(Boolean done)
          Caled post registration
 void preDeregister()
          Called before removal from the MBeanServer
 ObjectName preRegister(MBeanServer mbs, ObjectName on)
          Called at registration
 void propertyChange(PropertyChangeEvent event)
          Attribute change - fire notification
 void removeAttributeChangeNotificationListener(NotificationListener l, String attrName)
           
 void removeNotificationListener(NotificationListener l)
           
 void sendAttributeChangeNotification(Attribute oldAttr, Attribute newAttr)
           
 void sendAttributeChangeNotification(AttributeChangeNotification notification)
           
 void sendNotification(Notification notification)
           
 void sendNotification(String text)
           
 void setAttribute(Attribute attr)
          Set the Attribute
 AttributeList setAttributes(AttributeList attributes)
          Set values of Attributes
 void updateAttribute(String name, Object value)
          Update a named attribute
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executorService

protected ExecutorService executorService
Constructor Detail

BaseStandardMBean

public BaseStandardMBean(Object object,
                         Class interfaceMBean,
                         String description,
                         MBeanAttributeInfo[] attrs,
                         MBeanOperationInfo[] ops,
                         ExecutorService executorService)
                  throws ReflectionException,
                         NotCompliantMBeanException
Constructor

Parameters:
object -
interfaceMBean -
description -
attrs -
ops -
executorService2 -
Throws:
ReflectionException
NotCompliantMBeanException
Method Detail

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean
Overrides:
getMBeanInfo in class StandardMBean
Returns:
the MBeanINfo for this MBean

getObjectName

public ObjectName getObjectName()
Retrieve ObjectName of the MBean - set after registration

Returns:
the ObjectName of the MBean

getBeanServer

public MBeanServer getBeanServer()
Retrieve the MBeanServer - set after registration

Returns:
the beanServer

getAttribute

public Object getAttribute(String name)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
Get the Value of an Attribute

Specified by:
getAttribute in interface DynamicMBean
Overrides:
getAttribute in class StandardMBean
Parameters:
name -
Returns:
the value of the Attribute
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

setAttribute

public void setAttribute(Attribute attr)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Set the Attribute

Specified by:
setAttribute in interface DynamicMBean
Overrides:
setAttribute in class StandardMBean
Parameters:
attr -
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

updateAttribute

public void updateAttribute(String name,
                            Object value)
Update a named attribute

Parameters:
name -
value -

propertyChange

public void propertyChange(PropertyChangeEvent event)
Attribute change - fire notification

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
event -

getAttributes

public AttributeList getAttributes(String[] attributes)
Specified by:
getAttributes in interface DynamicMBean
Overrides:
getAttributes in class StandardMBean
Parameters:
attributes - - array of Attribute names
Returns:
AttributeList of matching Attributes

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Set values of Attributes

Specified by:
setAttributes in interface DynamicMBean
Overrides:
setAttributes in class StandardMBean
Parameters:
attributes -
Returns:
the list of Attributes set with their new values

invoke

public Object invoke(String name,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Invoke an operation

Specified by:
invoke in interface DynamicMBean
Overrides:
invoke in class StandardMBean
Parameters:
name -
params -
signature -
Returns:
result of invoking an operation
Throws:
MBeanException
ReflectionException

preRegister

public ObjectName preRegister(MBeanServer mbs,
                              ObjectName on)
                       throws Exception
Called at registration

Specified by:
preRegister in interface MBeanRegistration
Parameters:
mbs -
on -
Returns:
the ObjectName
Throws:
Exception

postRegister

public void postRegister(Boolean done)
Caled post registration

Specified by:
postRegister in interface MBeanRegistration
Parameters:
done -

preDeregister

public void preDeregister()
                   throws Exception
Called before removal from the MBeanServer

Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Called after removal from the MBeanServer

Specified by:
postDeregister in interface MBeanRegistration

sendNotification

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

sendNotification

public void sendNotification(String text)
                      throws MBeanException,
                             RuntimeOperationsException
Specified by:
sendNotification in interface ModelMBeanNotificationBroadcaster
Parameters:
text -
Throws:
MBeanException
RuntimeOperationsException

addAttributeChangeNotificationListener

public void addAttributeChangeNotificationListener(NotificationListener l,
                                                   String attrName,
                                                   Object handback)
                                            throws MBeanException,
                                                   RuntimeOperationsException,
                                                   IllegalArgumentException
Specified by:
addAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcaster
Parameters:
l -
attrName -
handback -
Throws:
MBeanException
RuntimeOperationsException
IllegalArgumentException

removeAttributeChangeNotificationListener

public void removeAttributeChangeNotificationListener(NotificationListener l,
                                                      String attrName)
                                               throws MBeanException,
                                                      RuntimeOperationsException,
                                                      ListenerNotFoundException
Specified by:
removeAttributeChangeNotificationListener in interface ModelMBeanNotificationBroadcaster
Parameters:
l -
attrName -
Throws:
MBeanException
RuntimeOperationsException
ListenerNotFoundException

sendAttributeChangeNotification

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

sendAttributeChangeNotification

public void sendAttributeChangeNotification(Attribute oldAttr,
                                            Attribute newAttr)
                                     throws MBeanException,
                                            RuntimeOperationsException
Specified by:
sendAttributeChangeNotification in interface ModelMBeanNotificationBroadcaster
Parameters:
oldAttr -
newAttr -
Throws:
MBeanException
RuntimeOperationsException

getNotificationInfo

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

addNotificationListener

public void addNotificationListener(NotificationListener l,
                                    NotificationFilter filter,
                                    Object handle)
                             throws IllegalArgumentException
Specified by:
addNotificationListener in interface NotificationBroadcaster
Parameters:
l -
filter -
handle -
Throws:
IllegalArgumentException

removeNotificationListener

public void removeNotificationListener(NotificationListener l)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Parameters:
l -
Throws:
ListenerNotFoundException


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.