org.oddjob.jmx.server
Class OddjobMBean

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.oddjob.jmx.server.OddjobMBean
All Implemented Interfaces:
DynamicMBean, NotificationBroadcaster, NotificationEmitter

public class OddjobMBean
extends NotificationBroadcasterSupport
implements DynamicMBean

A MBean which wraps an object providing an Oddjob management interface to the object.

Once the bean is created it will sit and wait for clients to interrigate it. When a client accesses the bean it should call the resync method which will cause the bean to resend the notifications necessary to recreate in the client, the state of the bean. During the resync the InterfaceHandlers should block any any more changes until the resync has completed.

Author:
Rob Gordon.

Constructor Summary
OddjobMBean(Object node, ObjectName objectName, ServerSession factory, ServerContext srvcon)
          Constructor.
 
Method Summary
 void destroy()
          Destroy this node.
 Object getAttribute(String attribute)
           
 AttributeList getAttributes(String[] attributes)
           
 MBeanInfo getMBeanInfo()
           
 Object getNode()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 Object invoke(String actionName, Object[] params, String[] signature)
           
 void setAttribute(Attribute attribute)
           
 AttributeList setAttributes(AttributeList attributes)
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OddjobMBean

public OddjobMBean(Object node,
                   ObjectName objectName,
                   ServerSession factory,
                   ServerContext srvcon)
Constructor.

Parameters:
node - The job this is shadowing.
objectName - The objectName for this node.
factory - The factory for creating child OddjobMBeans. May be null only if this MBean will never have children.
srvcon - The server context The server context. Must not be null.
Throws:
RemoteException
Method Detail

getNode

public Object getNode()

getAttribute

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

setAttribute

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

getAttributes

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

setAttributes

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

invoke

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

getMBeanInfo

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

getNotificationInfo

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

destroy

public void destroy()
Destroy this node. Notify all remote listeners their peer is dead.