| java.lang.Object org.apache.tomcat.util.modeler.BaseModelMBean
All known Subclasses: org.apache.catalina.mbeans.StandardHostMBean, org.apache.catalina.mbeans.StandardServiceMBean, org.apache.catalina.mbeans.ContextResourceLinkMBean, org.apache.catalina.mbeans.ContextEnvironmentMBean, org.apache.catalina.mbeans.MemoryUserDatabaseMBean, org.apache.catalina.mbeans.NamingResourcesMBean, org.apache.catalina.mbeans.GroupMBean, org.apache.catalina.mbeans.DefaultContextMBean, org.apache.catalina.mbeans.StandardContextMBean, org.apache.catalina.mbeans.StandardServerMBean, org.apache.catalina.mbeans.StandardEngineMBean, org.apache.catalina.mbeans.ClassNameMBean, org.apache.catalina.mbeans.MBeanFactory, org.apache.catalina.mbeans.UserMBean, org.apache.catalina.mbeans.ContextResourceMBean, org.apache.catalina.mbeans.RoleMBean,
BaseModelMBean | public class BaseModelMBean implements DynamicMBean,MBeanRegistration,ModelMBeanNotificationBroadcaster(Code) | | 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:
- Only managed resources of type
objectReference are
supportd.
- Caching of attribute values and operation results is not supported.
All calls to
invoke() are immediately executed.
- Persistence of MBean attributes and operations is not supported.
- All classes referenced as attribute types, operation parameters, or
operation return values must be one of the following:
- One of the Java primitive types (boolean, byte, char, double,
float, integer, long, short). Corresponding value will be wrapped
in the appropriate wrapper class automatically.
- Operations that return no value should declare a return type of
void .
- Attribute caching is not supported
author: Craig R. McClanahan author: Costin Manolache |
Inner Class :static class MethodKey | |
Constructor Summary | |
protected | BaseModelMBean() Construct a ModelMBean with default
ModelMBeanInfo information. |
Method Summary | |
public void | addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback) Add an attribute change notification event listener to this MBean. | public void | addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) Add a notification event listener to this MBean. | public Object | getAttribute(String name) Obtain and return the value of a specific attribute of this MBean. | static Class | getAttributeClass(String signature) | 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() 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. | 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) Invoke a particular method on this MBean, and return any returned
value. | public void | postDeregister() | public void | postRegister(Boolean registrationDone) | public void | preDeregister() | public ObjectName | preRegister(MBeanServer server, ObjectName name) | public void | removeAttributeChangeNotificationListener(NotificationListener listener, String name) Remove an attribute change notification event listener from
this MBean. | public void | removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) Remove an attribute change notification event listener from
this MBean. | public void | removeNotificationListener(NotificationListener listener) Remove a notification event listener from this MBean. | public void | removeNotificationListener(NotificationListener listener, Object handback) Remove a notification event listener from this MBean. | public void | removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) Remove a notification event listener from this MBean. | public void | sendAttributeChangeNotification(AttributeChangeNotification notification) Send an AttributeChangeNotification to all registered
listeners. | public void | sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) Send an AttributeChangeNotification to all registered
listeners. | public void | sendNotification(Notification notification) Send a Notification to all registered listeners as a
jmx.modelmbean.general notification. | public void | sendNotification(String message) Send a Notification which contains the specified string
as a jmx.modelmbean.generic notification. | public void | setAttribute(Attribute attribute) 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) 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. | public String | toString() |
NO_ARGS_PARAM_SIG | final static Class[] NO_ARGS_PARAM_SIG(Code) | | |
resource | protected Object resource(Code) | | The managed resource this MBean is associated with (if any).
|
addAttributeChangeNotificationListener | public void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback) throws IllegalArgumentException(Code) | | Add an attribute change notification event listener to this MBean.
Parameters: listener - Listener that will receive event notifications Parameters: name - Name of the attribute of interest, or null to indicate interest in all attributes Parameters: handback - Handback object to be sent along with eventnotifications exception: IllegalArgumentException - if the listener parameter is null |
addNotificationListener | public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException(Code) | | Add a notification event listener to this MBean.
Parameters: listener - Listener that will receive event notifications Parameters: filter - Filter object used to filter event notificationsactually delivered, or null for no filtering Parameters: handback - Handback object to be sent along with eventnotifications exception: IllegalArgumentException - if the listener parameter is null |
getAttributes | public AttributeList getAttributes(String names)(Code) | | Obtain and return the values of several attributes of this MBean.
Parameters: names - Names of the requested attributes |
getMBeanInfo | public MBeanInfo getMBeanInfo()(Code) | | Return the MBeanInfo object for this MBean.
|
getModelerType | public String getModelerType()(Code) | | Set the type of the mbean. This is used as a key to locate
the description in the Registry.
|
getNotificationInfo | public MBeanNotificationInfo[] getNotificationInfo()(Code) | | Return an MBeanNotificationInfo object describing the
notifications sent by this MBean.
|
invoke | public Object invoke(String name, Object params, String signature) throws MBeanException, ReflectionException(Code) | | 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.
Parameters: name - Name of the operation to be invoked Parameters: params - Array containing the method parameters of this operation Parameters: signature - Array containing the class names representingthe signature of this operation exception: MBeanException - if the initializer of an objectthrows an exception exception: ReflectioNException - if a Java reflection exceptionoccurs when invoking a method |
postDeregister | public void postDeregister()(Code) | | |
postRegister | public void postRegister(Boolean registrationDone)(Code) | | |
preRegister | public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code) | | Is the specified ModelMBeanInfo instance valid?
IMPLEMENTATION NOTE - This implementation
does not check anything, but this method can be overridden
as required.
Parameters: info - The ModelMBeanInfo object to check |
removeAttributeChangeNotificationListener | public void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws ListenerNotFoundException(Code) | | Remove an attribute change notification event listener from
this MBean.
Parameters: listener - The listener to be removed Parameters: name - The attribute name for which no more events are required exception: ListenerNotFoundException - if this listener is notregistered in the MBean |
removeAttributeChangeNotificationListener | public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws ListenerNotFoundException(Code) | | Remove an attribute change notification event listener from
this MBean.
Parameters: listener - The listener to be removed Parameters: attributeName - The attribute name for which no more events are required Parameters: handback - Handback object to be sent along with eventnotifications exception: ListenerNotFoundException - if this listener is notregistered in the MBean |
removeNotificationListener | public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code) | | Remove a notification event listener from this MBean.
Parameters: listener - The listener to be removed (any and all registrationsfor this listener will be eliminated) exception: ListenerNotFoundException - if this listener is notregistered in the MBean |
removeNotificationListener | public void removeNotificationListener(NotificationListener listener, Object handback) throws ListenerNotFoundException(Code) | | Remove a notification event listener from this MBean.
Parameters: listener - The listener to be removed (any and all registrationsfor this listener will be eliminated) Parameters: handback - Handback object to be sent along with eventnotifications exception: ListenerNotFoundException - if this listener is notregistered in the MBean |
removeNotificationListener | public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code) | | Remove a notification event listener from this MBean.
Parameters: listener - The listener to be removed (any and all registrationsfor this listener will be eliminated) Parameters: filter - Filter object used to filter event notificationsactually delivered, or null for no filtering Parameters: handback - Handback object to be sent along with eventnotifications exception: ListenerNotFoundException - if this listener is notregistered in the MBean |
sendAttributeChangeNotification | public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException(Code) | | Send an AttributeChangeNotification to all registered
listeners.
Parameters: oldValue - The original value of the Attribute Parameters: newValue - The new value of the Attribute exception: MBeanException - if an object initializer throws anexception exception: RuntimeOperationsException - wraps IllegalArgumentExceptionwhen the specified notification is null or invalid |
setAttributes | public AttributeList setAttributes(AttributeList attributes)(Code) | | Set the values of several attributes of this MBean.
Parameters: attributes - THe names and values to be set The list of attributes that were set and their new values |
setManagedResource | public void setManagedResource(Object resource, String type) throws InstanceNotFoundException, MBeanException, RuntimeOperationsException(Code) | | 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.
Parameters: resource - The resource object to be managed Parameters: type - The type of reference for the managed resource("ObjectReference", "Handle", "IOR", "EJBHandle", or"RMIReference") exception: InstanceNotFoundException - if the managed resource objectcannot be found exception: InvalidTargetObjectTypeException - if this ModelMBean isasked to handle a reference type it cannot deal with exception: MBeanException - if the initializer of the object throwsan exception exception: RuntimeOperationsException - if the managed resource or theresource type is null or invalid |
|
|