Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » tomcat » util » modeler » [javadoc | source]
org.apache.tomcat.util.modeler
public class: BaseModelMBean [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.modeler.BaseModelMBean

All Implemented Interfaces:
    ModelMBeanNotificationBroadcaster, DynamicMBean, MBeanRegistration

Direct Known Subclasses:
    StandardHostMBean, DefaultContextMBean, MemoryUserDatabaseMBean, ContextResourceLinkMBean, NamingResourcesMBean, StandardContextMBean, GroupMBean, ConnectorMBean, StandardEngineMBean, UserMBean, ClassNameMBean, StandardServerMBean, StandardServiceMBean, ContextEnvironmentMBean, ContextResourceMBean, MBeanFactory, RoleMBean

Basic implementation of the DynamicMBean interface, which supports the minimal requirements of the interface contract.

This can be used directly to wrap an existing java bean, or inside an mlet or anywhere an MBean would be used. Limitations:

Nested Class Summary:
static class  BaseModelMBean.MethodKey   
Field Summary
protected  ObjectName oname     
protected  BaseNotificationBroadcaster attributeBroadcaster    Notification broadcaster for attribute changes. 
protected  BaseNotificationBroadcaster generalBroadcaster    Notification broadcaster for general notifications. 
protected  ManagedBean managedBean    Metadata for the mbean instance. 
protected  Object resource    The managed resource this MBean is associated with (if any). 
static final  Object[] NO_ARGS_PARAM     
static final  Class[] NO_ARGS_PARAM_SIG     
protected  String resourceType     
Constructor:
 protected BaseModelMBean() throws RuntimeOperationsException, MBeanException 
    Construct a ModelMBean with default ModelMBeanInfo information.
    Throws:
    MBeanException - if the initializer of an object throws an exception
    RuntimeOperationsException - if an IllegalArgumentException occurs
    exception: MBeanException - if the initializer of an object throws an exception
    exception: RuntimeOperationsException - if an IllegalArgumentException occurs
Method from org.apache.tomcat.util.modeler.BaseModelMBean Summary:
addAttributeChangeNotificationListener,   addNotificationListener,   getAttribute,   getAttributeClass,   getAttributes,   getClassName,   getJmxName,   getMBeanInfo,   getManagedResource,   getModelerType,   getNotificationInfo,   getObjectName,   invoke,   postDeregister,   postRegister,   preDeregister,   preRegister,   removeAttributeChangeNotificationListener,   removeAttributeChangeNotificationListener,   removeNotificationListener,   removeNotificationListener,   removeNotificationListener,   sendAttributeChangeNotification,   sendAttributeChangeNotification,   sendNotification,   sendNotification,   setAttribute,   setAttributes,   setManagedBean,   setManagedResource,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.modeler.BaseModelMBean Detail:
 public  void addAttributeChangeNotificationListener(NotificationListener listener,
    String name,
    Object handback) throws IllegalArgumentException 
    Add an attribute change notification event listener to this MBean.
 public  void addNotificationListener(NotificationListener listener,
    NotificationFilter filter,
    Object handback) throws IllegalArgumentException 
    Add a notification event listener to this MBean.
 public Object getAttribute(String name) throws ReflectionException, AttributeNotFoundException, MBeanException 
    Obtain and return the value of a specific attribute of this MBean.
 static Class getAttributeClass(String signature) throws ReflectionException 
 public AttributeList getAttributes(String[] names) 
    Obtain and return the values of several attributes of this MBean.
 public String getClassName() 
 public ObjectName getJmxName() 
 public MBeanInfo getMBeanInfo() 
    Return the MBeanInfo object for this MBean.
 public Object getManagedResource() throws InstanceNotFoundException, InvalidTargetObjectTypeException, RuntimeOperationsException, MBeanException 
    Get the instance handle of the object against which we execute all methods in this ModelMBean management interface.
 public String getModelerType() 
    Set the type of the mbean. This is used as a key to locate the description in the Registry.
 public MBeanNotificationInfo[] getNotificationInfo() 
    Return an MBeanNotificationInfo object describing the notifications sent by this MBean.
 public String getObjectName() 
 public Object invoke(String name,
    Object[] params,
    String[] signature) throws ReflectionException, MBeanException 
    Invoke a particular method on this MBean, and return any returned value.

    IMPLEMENTATION NOTE - This implementation will attempt to invoke this method on the MBean itself, or (if not available) on the managed resource object associated with this MBean.

 public  void postDeregister() 
 public  void postRegister(Boolean registrationDone) 
 public  void preDeregister() throws Exception 
 public ObjectName preRegister(MBeanServer server,
    ObjectName name) throws Exception 
    Is the specified ModelMBeanInfo instance valid?

    IMPLEMENTATION NOTE - This implementation does not check anything, but this method can be overridden as required.

 public  void removeAttributeChangeNotificationListener(NotificationListener listener,
    String name) throws ListenerNotFoundException 
    Remove an attribute change notification event listener from this MBean.
 public  void removeAttributeChangeNotificationListener(NotificationListener listener,
    String attributeName,
    Object handback) throws ListenerNotFoundException 
    Remove an attribute change notification event listener from this MBean.
 public  void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException 
    Remove a notification event listener from this MBean.
 public  void removeNotificationListener(NotificationListener listener,
    Object handback) throws ListenerNotFoundException 
    Remove a notification event listener from this MBean.
 public  void removeNotificationListener(NotificationListener listener,
    NotificationFilter filter,
    Object handback) throws ListenerNotFoundException 
    Remove a notification event listener from this MBean.
 public  void sendAttributeChangeNotification(AttributeChangeNotification notification) throws RuntimeOperationsException, MBeanException 
    Send an AttributeChangeNotification to all registered listeners.
 public  void sendAttributeChangeNotification(Attribute oldValue,
    Attribute newValue) throws RuntimeOperationsException, MBeanException 
    Send an AttributeChangeNotification to all registered listeners.
 public  void sendNotification(Notification notification) throws RuntimeOperationsException, MBeanException 
    Send a Notification to all registered listeners as a jmx.modelmbean.general notification.
 public  void sendNotification(String message) throws RuntimeOperationsException, MBeanException 
    Send a Notification which contains the specified string as a jmx.modelmbean.generic notification.
 public  void setAttribute(Attribute attribute) throws ReflectionException, AttributeNotFoundException, MBeanException 
    Set the value of a specific attribute of this MBean.
 public AttributeList setAttributes(AttributeList attributes) 
    Set the values of several attributes of this MBean.
 public  void setManagedBean(ManagedBean managedBean) 
 public  void setManagedResource(Object resource,
    String type) throws InstanceNotFoundException, RuntimeOperationsException, MBeanException 
    Set the instance handle of the object against which we will execute all methods in this ModelMBean management interface. This method will detect and call "setModelMbean" method. A resource can implement this method to get a reference to the model mbean. The reference can be used to send notification and access the registry. The caller can provide the mbean instance or the object name to the resource, if needed.
 public String toString()