org.realityforge.metaclass.jmx
Class WrapperModelMBean

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.modelmbean.RequiredModelMBean
              |
              +--org.realityforge.metaclass.jmx.WrapperModelMBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.modelmbean.ModelMBeanNotificationBroadcaster, javax.management.NotificationBroadcaster, javax.management.PersistentMBean

public class WrapperModelMBean
extends javax.management.modelmbean.RequiredModelMBean
implements javax.management.MBeanRegistration

A extension of RequiredModelMBean that propogates MBeanRegistration events to managed object.

Version:
$Revision: 1.4 $ $Date: 2003/10/14 01:27:28 $
Author:
Peter Donald

Constructor Summary
WrapperModelMBean(javax.management.modelmbean.ModelMBeanInfo info, Object managedResource)
          Create the MBean.
 
Method Summary
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setManagedResource(Object resource, String resourceType)
          Overloaded setManagedResource that caches the resource.
 
Methods inherited from class javax.management.modelmbean.RequiredModelMBean
addAttributeChangeNotificationListener, getAttribute, getAttributes, getMBeanInfo, invoke, load, removeAttributeChangeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, setAttribute, setAttributes, setModelMBeanInfo, store
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
sendNotification
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Constructor Detail

WrapperModelMBean

public WrapperModelMBean(javax.management.modelmbean.ModelMBeanInfo info,
                         Object managedResource)
                  throws javax.management.JMException,
                         javax.management.modelmbean.InvalidTargetObjectTypeException
Create the MBean.

Parameters:
info - the ModelMBeanInfo object.
managedResource - the managed resource
Throws:
javax.management.JMException - if error creating MBean
javax.management.modelmbean.InvalidTargetObjectTypeException - if thrown from setManagedResource
Method Detail

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Overrides:
preRegister in class javax.management.modelmbean.RequiredModelMBean
Exception
See Also:
MBeanRegistration.preRegister(MBeanServer, ObjectName)

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration
Overrides:
postRegister in class javax.management.modelmbean.RequiredModelMBean
See Also:
MBeanRegistration.postRegister(Boolean)

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Overrides:
preDeregister in class javax.management.modelmbean.RequiredModelMBean
Exception
See Also:
MBeanRegistration.preDeregister()

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration
Overrides:
postDeregister in class javax.management.modelmbean.RequiredModelMBean
See Also:
MBeanRegistration.postDeregister()

setManagedResource

public void setManagedResource(Object resource,
                               String resourceType)
                        throws javax.management.MBeanException,
                               javax.management.RuntimeOperationsException,
                               javax.management.InstanceNotFoundException,
                               javax.management.modelmbean.InvalidTargetObjectTypeException
Overloaded setManagedResource that caches the resource.

Specified by:
setManagedResource in interface javax.management.modelmbean.ModelMBean
Overrides:
setManagedResource in class javax.management.modelmbean.RequiredModelMBean
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.InstanceNotFoundException
javax.management.modelmbean.InvalidTargetObjectTypeException
See Also:
RequiredModelMBean.setManagedResource(Object,String)


Copyright © 2003 The Spice Group. All Rights Reserved.