org.progeeks.jmx
Class MetaObjectMBean

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.progeeks.jmx.MetaObjectMBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class MetaObjectMBean
extends javax.management.NotificationBroadcasterSupport
implements javax.management.DynamicMBean, javax.management.MBeanRegistration

Wraps a MetaObject to make it compatible with the MBean interface. The MetaObject can either be specified by constructor or created during construction from a standard or specified type.

Version:
$Revision: 1.2 $
Author:
Paul Speed

Constructor Summary
MetaObjectMBean(MetaClass mClass)
          Creates a MetaObjectMBean that will wrap a MapMetaObject of the specified meta-class.
MetaObjectMBean(MetaObject mObj)
          Creates MetaObjectMBean that will wrap the specified meta-object for registration within an MBean server.
MetaObjectMBean(java.lang.String metaClassName)
          Creates a MetaObjectMBean that will wrap a MapMetaObject of the specified meta-class.
 
Method Summary
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.Object getAttribute(java.lang.String name)
           
 javax.management.AttributeList getAttributes(java.lang.String[] names)
           
 javax.management.MBeanInfo getMBeanInfo()
           
 java.lang.Object invoke(java.lang.String name, java.lang.Object[] parms, java.lang.String[] signature)
           
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
protected  void setMetaClass(MetaClass mClass)
           
protected  void setMetaObject(MetaObject mObject)
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaObjectMBean

public MetaObjectMBean(MetaObject mObj)
Creates MetaObjectMBean that will wrap the specified meta-object for registration within an MBean server.


MetaObjectMBean

public MetaObjectMBean(java.lang.String metaClassName)
Creates a MetaObjectMBean that will wrap a MapMetaObject of the specified meta-class. The meta-class is resolved the first time the MBeanInfo is requested... usually during server registration.


MetaObjectMBean

public MetaObjectMBean(MetaClass mClass)
Creates a MetaObjectMBean that will wrap a MapMetaObject of the specified meta-class.

Method Detail

setMetaClass

protected void setMetaClass(MetaClass mClass)

setMetaObject

protected void setMetaObject(MetaObject mObject)

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] names)
Specified by:
getAttributes in interface javax.management.DynamicMBean

setAttributes

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

invoke

public java.lang.Object invoke(java.lang.String name,
                               java.lang.Object[] parms,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.DynamicMBean
Throws:
javax.management.MBeanException
javax.management.ReflectionException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean


Copyright © 2002-2003 Paul Speed. All Rights Reserved.