javax.management.modelmbean
Class RequiredModelMBean

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.modelmbean.RequiredModelMBean
All Implemented Interfaces:
DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean , MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration , ModelMBean sample code for javax.management.modelmbean.ModelMBean definition code for javax.management.modelmbean.ModelMBean , ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster , NotificationBroadcaster sample code for javax.management.NotificationBroadcaster definition code for javax.management.NotificationBroadcaster , NotificationEmitter sample code for javax.management.NotificationEmitter definition code for javax.management.NotificationEmitter , PersistentMBean sample code for javax.management.PersistentMBean definition code for javax.management.PersistentMBean

public class RequiredModelMBean
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements ModelMBean sample code for javax.management.modelmbean.ModelMBean definition code for javax.management.modelmbean.ModelMBean , MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration , NotificationEmitter sample code for javax.management.NotificationEmitter definition code for javax.management.NotificationEmitter

This class is the implementation of a ModelMBean. An appropriate implementation of a ModelMBean must be shipped with every JMX Agent and the class must be named RequiredModelMBean.

Java resources wishing to be manageable instantiate the RequiredModelMBean using the MBeanServer's createMBean method. The resource then sets the MBeanInfo and Descriptors for the RequiredModelMBean instance. The attributes and operations exposed via the ModelMBeanInfo for the ModelMBean are accessible from MBeans, connectors/adaptors like other MBeans. Through the Descriptors, values and methods in the managed application can be defined and mapped to attributes and operations of the ModelMBean. This mapping can be defined in an XML formatted file or dynamically and programmatically at runtime.

Every RequiredModelMBean which is instantiated in the MBeanServer becomes manageable:
its attributes and operations become remotely accessible through the connectors/adaptors connected to that MBeanServer.

A Java object cannot be registered in the MBeanServer unless it is a JMX compliant MBean. By instantiating a RequiredModelMBean, resources are guaranteed that the MBean is valid. MBeanException and RuntimeOperationsException must be thrown on every public method. This allows for wrapping exceptions from distributed communications (RMI, EJB, etc.)

Since:
1.5

Constructor Summary
RequiredModelMBean sample code for javax.management.modelmbean.RequiredModelMBean.RequiredModelMBean() definition code for javax.management.modelmbean.RequiredModelMBean.RequiredModelMBean() ()
          Constructs an RequiredModelMBean with an empty ModelMBeanInfo.
RequiredModelMBean sample code for javax.management.modelmbean.RequiredModelMBean.RequiredModelMBean(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.RequiredModelMBean(javax.management.modelmbean.ModelMBeanInfo) (ModelMBeanInfo sample code for javax.management.modelmbean.ModelMBeanInfo definition code for javax.management.modelmbean.ModelMBeanInfo  mbi)
          Constructs a RequiredModelMBean object using ModelMBeanInfo passed in.
 
Method Summary
 void addAttributeChangeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) (NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  inlistener, String sample code for java.lang.String definition code for java.lang.String  inAttributeName, Object sample code for java.lang.Object definition code for java.lang.Object  inhandback)
          Registers an object which implements the NotificationListener interface as a listener.
 void addNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) (NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener, NotificationFilter sample code for javax.management.NotificationFilter definition code for javax.management.NotificationFilter  filter, Object sample code for java.lang.Object definition code for java.lang.Object  handback)
          Registers an object which implements the NotificationListener interface as a listener.
 Object sample code for java.lang.Object definition code for java.lang.Object getAttribute sample code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  attrName)
          Returns the value of a specific attribute defined for this ModelMBean.
 AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList getAttributes sample code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[]) definition code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] attrNames)
          Returns the values of several attributes in the ModelMBean.
protected  ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository getClassLoaderRepository sample code for javax.management.modelmbean.RequiredModelMBean.getClassLoaderRepository() definition code for javax.management.modelmbean.RequiredModelMBean.getClassLoaderRepository() ()
          Return the Class Loader Repository used to perform class loading.
 MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo getMBeanInfo sample code for javax.management.modelmbean.RequiredModelMBean.getMBeanInfo() definition code for javax.management.modelmbean.RequiredModelMBean.getMBeanInfo() ()
          Returns the attributes, operations, constructors and notifications that this RequiredModelMBean exposes for management.
 MBeanNotificationInfo sample code for javax.management.MBeanNotificationInfo definition code for javax.management.MBeanNotificationInfo [] getNotificationInfo sample code for javax.management.modelmbean.RequiredModelMBean.getNotificationInfo() definition code for javax.management.modelmbean.RequiredModelMBean.getNotificationInfo() ()
          Returns the array of Notifications always generated by the RequiredModelMBean.
 Object sample code for java.lang.Object definition code for java.lang.Object invoke sample code for javax.management.modelmbean.RequiredModelMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.modelmbean.RequiredModelMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String  opName, Object sample code for java.lang.Object definition code for java.lang.Object [] opArgs, String sample code for java.lang.String definition code for java.lang.String [] sig)
          Invokes a method on or through a RequiredModelMBean and returns the result of the method execution.
 void load sample code for javax.management.modelmbean.RequiredModelMBean.load() definition code for javax.management.modelmbean.RequiredModelMBean.load() ()
          Instantiates this MBean instance with the data found for the MBean in the persistent store.
 void postDeregister sample code for javax.management.modelmbean.RequiredModelMBean.postDeregister() definition code for javax.management.modelmbean.RequiredModelMBean.postDeregister() ()
          Allows the MBean to perform any operations needed after having been unregistered in the MBean server.
 void postRegister sample code for javax.management.modelmbean.RequiredModelMBean.postRegister(java.lang.Boolean) definition code for javax.management.modelmbean.RequiredModelMBean.postRegister(java.lang.Boolean) (Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
          Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
 void preDeregister sample code for javax.management.modelmbean.RequiredModelMBean.preDeregister() definition code for javax.management.modelmbean.RequiredModelMBean.preDeregister() ()
          Allows the MBean to perform any operations it needs before being unregistered by the MBean server.
 ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName preRegister sample code for javax.management.modelmbean.RequiredModelMBean.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.modelmbean.RequiredModelMBean.preRegister(javax.management.MBeanServer, javax.management.ObjectName) (MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server, ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
          Allows the MBean to perform any operations it needs before being registered in the MBean server.
 void removeAttributeChangeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) (NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  inlistener, String sample code for java.lang.String definition code for java.lang.String  inAttributeName)
          Removes a listener for attributeChangeNotifications from the RequiredModelMBean.
 void removeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener) definition code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener) (NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener)
          Removes a listener for Notifications from the RequiredModelMBean.
 void removeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) (NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener, NotificationFilter sample code for javax.management.NotificationFilter definition code for javax.management.NotificationFilter  filter, Object sample code for java.lang.Object definition code for java.lang.Object  handback)
          Removes a listener from this MBean.
 void sendAttributeChangeNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) definition code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) (Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  inOldVal, Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  inNewVal)
          Sends an attributeChangeNotification which contains the old value and new value for the attribute to the registered AttributeChangeNotification listeners on the ModelMBean.
 void sendAttributeChangeNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) definition code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) (AttributeChangeNotification sample code for javax.management.AttributeChangeNotification definition code for javax.management.AttributeChangeNotification  ntfyObj)
          Sends an attributeChangeNotification which is passed in to the registered attributeChangeNotification listeners on the ModelMBean.
 void sendNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendNotification(javax.management.Notification) definition code for javax.management.modelmbean.RequiredModelMBean.sendNotification(javax.management.Notification) (Notification sample code for javax.management.Notification definition code for javax.management.Notification  ntfyObj)
          Sends a Notification which is passed in to the registered Notification listeners on the ModelMBean as a jmx.modelmbean.generic notification.
 void sendNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendNotification(java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.sendNotification(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  ntfyText)
          Sends a Notification which contains the text string that is passed in to the registered Notification listeners on the ModelMBean.
 void setAttribute sample code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute) definition code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute) (Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  attribute)
          Sets the value of a specific attribute of a named ModelMBean.
 AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList setAttributes sample code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList) (AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  attributes)
          Sets the values of an array of attributes of this ModelMBean.
 void setManagedResource sample code for javax.management.modelmbean.RequiredModelMBean.setManagedResource(java.lang.Object, java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.setManagedResource(java.lang.Object, java.lang.String) (Object sample code for java.lang.Object definition code for java.lang.Object  mr, String sample code for java.lang.String definition code for java.lang.String  mr_type)
          Sets the instance handle of the object against which to execute all methods in this ModelMBean management interface (MBeanInfo and Descriptors).
 void setModelMBeanInfo sample code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) (ModelMBeanInfo sample code for javax.management.modelmbean.ModelMBeanInfo definition code for javax.management.modelmbean.ModelMBeanInfo  mbi)
          Initializes a ModelMBean object using ModelMBeanInfo passed in.
 void store sample code for javax.management.modelmbean.RequiredModelMBean.store() definition code for javax.management.modelmbean.RequiredModelMBean.store() ()
          Captures the current state of this MBean instance and writes it out to the persistent store.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

RequiredModelMBean sample code for javax.management.modelmbean.RequiredModelMBean() definition code for javax.management.modelmbean.RequiredModelMBean()

public RequiredModelMBean()
                   throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                          RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Constructs an RequiredModelMBean with an empty ModelMBeanInfo.

The RequiredModelMBean's MBeanInfo and Descriptors can be customized using the setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) sample code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) method. After the RequiredModelMBean's MBeanInfo and Descriptors are customized, the RequiredModelMBean can be registered with the MBeanServer.

Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps a RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException during the construction of the object.

RequiredModelMBean sample code for javax.management.modelmbean.RequiredModelMBean(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean(javax.management.modelmbean.ModelMBeanInfo)

public RequiredModelMBean(ModelMBeanInfo sample code for javax.management.modelmbean.ModelMBeanInfo definition code for javax.management.modelmbean.ModelMBeanInfo  mbi)
                   throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                          RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Constructs a RequiredModelMBean object using ModelMBeanInfo passed in. As long as the RequiredModelMBean is not registered with the MBeanServer yet, the RequiredModelMBean's MBeanInfo and Descriptors can be customized using the setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) sample code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) method. After the RequiredModelMBean's MBeanInfo and Descriptors are customized, the RequiredModelMBean can be registered with the MBeanServer.

Parameters:
mbi - The ModelMBeanInfo object to be used by the RequiredModelMBean. The given ModelMBeanInfo is cloned and modified as specified by setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) sample code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo)
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an {link java.lang.IllegalArgumentException}: The MBeanInfo passed in parameter is null.
Method Detail

setModelMBeanInfo sample code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.RequiredModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo)

public void setModelMBeanInfo(ModelMBeanInfo sample code for javax.management.modelmbean.ModelMBeanInfo definition code for javax.management.modelmbean.ModelMBeanInfo  mbi)
                       throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                              RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Initializes a ModelMBean object using ModelMBeanInfo passed in. This method makes it possible to set a customized ModelMBeanInfo on the ModelMBean as long as it is not registered with the MBeanServer.
Once the ModelMBean's ModelMBeanInfo (with Descriptors) are customized and set on the ModelMBean, the ModelMBean be registered with the MBeanServer.

If the ModelMBean is currently registered, this method throws a RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException wrapping an IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException

If the given inModelMBeanInfo does not contain any ModelMBeanNotificationInfo sample code for javax.management.modelmbean.ModelMBeanNotificationInfo definition code for javax.management.modelmbean.ModelMBeanNotificationInfo for the GENERIC or ATTRIBUTE_CHANGE notifications, then the RequiredModelMBean will supply its own default ModelMBeanNotificationInfo sample code for javax.management.modelmbean.ModelMBeanNotificationInfo definition code for javax.management.modelmbean.ModelMBeanNotificationInfo s for those missing notifications.

Specified by:
setModelMBeanInfo sample code for javax.management.modelmbean.ModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) definition code for javax.management.modelmbean.ModelMBean.setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) in interface ModelMBean sample code for javax.management.modelmbean.ModelMBean definition code for javax.management.modelmbean.ModelMBean
Parameters:
mbi - The ModelMBeanInfo object to be used by the ModelMBean.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException -

setManagedResource sample code for javax.management.modelmbean.RequiredModelMBean.setManagedResource(java.lang.Object, java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.setManagedResource(java.lang.Object, java.lang.String)

public void setManagedResource(Object sample code for java.lang.Object definition code for java.lang.Object  mr,
                               String sample code for java.lang.String definition code for java.lang.String  mr_type)
                        throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                               RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException ,
                               InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException ,
                               InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException 
Sets the instance handle of the object against which to execute all methods in this ModelMBean management interface (MBeanInfo and Descriptors).

Specified by:
setManagedResource sample code for javax.management.modelmbean.ModelMBean.setManagedResource(java.lang.Object, java.lang.String) definition code for javax.management.modelmbean.ModelMBean.setManagedResource(java.lang.Object, java.lang.String) in interface ModelMBean sample code for javax.management.modelmbean.ModelMBean definition code for javax.management.modelmbean.ModelMBean
Parameters:
mr - Object that is the managed resource
mr_type - The type of reference for the managed resource.
Can be: "ObjectReference", "Handle", "IOR", "EJBHandle", or "RMIReference".
In this implementation only "ObjectReference" is supported.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - The initializer of the object has thrown an exception.
InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException - The managed resource object could not be found
InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException - The managed resource type should be "ObjectReference".
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps a RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException when setting the resource.

load sample code for javax.management.modelmbean.RequiredModelMBean.load() definition code for javax.management.modelmbean.RequiredModelMBean.load()

public void load()
          throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                 RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException ,
                 InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException 

Instantiates this MBean instance with the data found for the MBean in the persistent store. The data loaded could include attribute and operation values.

This method should be called during construction or initialization of this instance, and before the MBean is registered with the MBeanServer.

If the implementation of this class does not support persistence, an MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException wrapping a ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException is thrown.

Specified by:
load sample code for javax.management.PersistentMBean.load() definition code for javax.management.PersistentMBean.load() in interface PersistentMBean sample code for javax.management.PersistentMBean definition code for javax.management.PersistentMBean
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps another exception, or persistence is not supported
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps exceptions from the persistence mechanism
InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException - Could not find or load this MBean from persistent storage

store sample code for javax.management.modelmbean.RequiredModelMBean.store() definition code for javax.management.modelmbean.RequiredModelMBean.store()

public void store()
           throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                  RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException ,
                  InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException 

Captures the current state of this MBean instance and writes it out to the persistent store. The state stored could include attribute and operation values.

If the implementation of this class does not support persistence, an MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException wrapping a ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException is thrown.

Persistence policy from the MBean and attribute descriptor is used to guide execution of this method. The MBean should be stored if 'persistPolicy' field is:

  != "never"
   = "always"
   = "onTimer" and now > 'lastPersistTime' + 'persistPeriod'
   = "NoMoreOftenThan" and now > 'lastPersistTime' + 'persistPeriod'
 

Do not store the MBean if 'persistPolicy' field is:

    = "never"
    = "onUpdate"
    = "onTimer" && now < 'lastPersistTime' + 'persistPeriod'
 

Specified by:
store sample code for javax.management.PersistentMBean.store() definition code for javax.management.PersistentMBean.store() in interface PersistentMBean sample code for javax.management.PersistentMBean definition code for javax.management.PersistentMBean
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps another exception, or persistence is not supported
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps exceptions from the persistence mechanism
InstanceNotFoundException sample code for javax.management.InstanceNotFoundException definition code for javax.management.InstanceNotFoundException - Could not find/access the persistent store

getMBeanInfo sample code for javax.management.modelmbean.RequiredModelMBean.getMBeanInfo() definition code for javax.management.modelmbean.RequiredModelMBean.getMBeanInfo()

public MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  getMBeanInfo()
Returns the attributes, operations, constructors and notifications that this RequiredModelMBean exposes for management.

Specified by:
getMBeanInfo sample code for javax.management.DynamicMBean.getMBeanInfo() definition code for javax.management.DynamicMBean.getMBeanInfo() in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Returns:
An instance of ModelMBeanInfo allowing retrieval all attributes, operations, and Notifications of this MBean.

invoke sample code for javax.management.modelmbean.RequiredModelMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.modelmbean.RequiredModelMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

public Object sample code for java.lang.Object definition code for java.lang.Object  invoke(String sample code for java.lang.String definition code for java.lang.String  opName,
                     Object sample code for java.lang.Object definition code for java.lang.Object [] opArgs,
                     String sample code for java.lang.String definition code for java.lang.String [] sig)
              throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                     ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Invokes a method on or through a RequiredModelMBean and returns the result of the method execution.

If the given method to be invoked, together with the provided signature, matches one of RequiredModelMbean accessible methods, this one will be call. Otherwise the call to the given method will be tried on the managed resource.

The last value returned by an operation may be cached in the operation's descriptor which is in the ModelMBeanOperationInfo's descriptor. The valid value will be in the 'value' field if there is one. If the 'currencyTimeLimit' field in the descriptor is:

Note: because of inconsistencies in previous versions of this specification, it is recommended not to use negative or zero values for currencyTimeLimit. To indicate that a cached value is never valid, omit the currencyTimeLimit field. To indicate that it is always valid, use a very large number for this field.

Specified by:
invoke sample code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
opName - The name of the method to be invoked. The name can be the fully qualified method name including the classname, or just the method name if the classname is defined in the 'class' field of the operation descriptor.
opArgs - An array containing the parameters to be set when the operation is invoked
sig - An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the MBean on which the operation was invoked.
Returns:
The object returned by the method, which represents the result of invoking the method on the specified managed resource.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps one of the following Exceptions:
  • An Exception thrown by the managed object's invoked method.
  • ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException : No ModelMBeanOperationInfo or no descriptor defined for the specified operation or the managed resource is null.
  • InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException : The 'targetType' field value is not 'objectReference'.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps an Exception sample code for java.lang.Exception definition code for java.lang.Exception thrown while trying to invoke the method.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException Method name is null.

getAttribute sample code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String)

public Object sample code for java.lang.Object definition code for java.lang.Object  getAttribute(String sample code for java.lang.String definition code for java.lang.String  attrName)
                    throws AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException ,
                           MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                           ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Returns the value of a specific attribute defined for this ModelMBean. The last value returned by an attribute may be cached in the attribute's descriptor. The valid value will be in the 'value' field if there is one. If the 'currencyTimeLimit' field in the descriptor is:

Note: because of inconsistencies in previous versions of this specification, it is recommended not to use negative or zero values for currencyTimeLimit. To indicate that a cached value is never valid, omit the currencyTimeLimit field. To indicate that it is always valid, use a very large number for this field.

If the 'getMethod' field contains the name of a valid operation descriptor, then the method described by the operation descriptor is executed. The response from the method is returned as the value of the attribute. If the operation fails or the returned value is not of the same type as the attribute, an exception will be thrown. If no 'getMethod' field is defined then the default value of the attribute is returned. In this implementation, in every case where the getMethod needs to be called, because the method is invoked through the standard "invoke" method and thus needs operationInfo, an operation must be specified for that getMethod so that the invocation works correctly.

Specified by:
getAttribute sample code for javax.management.DynamicMBean.getAttribute(java.lang.String) definition code for javax.management.DynamicMBean.getAttribute(java.lang.String) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attrName - A String specifying the name of the attribute to be retrieved. It must match the name of a ModelMBeanAttributeInfo.
Returns:
The value of the retrieved attribute from the descriptor 'value' field or from the invocation of the operation in the 'getMethod' field of the descriptor.
Throws:
AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException - The specified attribute is not accessible in the MBean. The following cases may result in an AttributeNotFoundException:
  • No ModelMBeanInfo was found for the Model MBean.
  • No ModelMBeanAttributeInfo was found for the specified attribute name.
  • The ModelMBeanAttributeInfo isReadable method returns 'false'.
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps one of the following Exceptions:
  • InvalidAttributeValueException sample code for javax.management.InvalidAttributeValueException definition code for javax.management.InvalidAttributeValueException : A wrong value type was received from the attribute's getter method or no 'getMethod' field defined in the descriptor for the attribute and no default value exists.
  • ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException : No ModelMBeanOperationInfo defined for the attribute's getter method or no descriptor associated with the ModelMBeanOperationInfo or the managed resource is null.
  • InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException The 'targetType' field value is not 'objectReference'.
  • An Exception thrown by the managed object's getter.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps an Exception sample code for java.lang.Exception definition code for java.lang.Exception thrown while trying to invoke the getter.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException : The attribute name in parameter is null.
See Also:
setAttribute(javax.management.Attribute) sample code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute) definition code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute)

getAttributes sample code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[]) definition code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[])

public AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  getAttributes(String sample code for java.lang.String definition code for java.lang.String [] attrNames)
Returns the values of several attributes in the ModelMBean. Executes a getAttribute for each attribute name in the attrNames array passed in.

Specified by:
getAttributes sample code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) definition code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attrNames - A String array of names of the attributes to be retrieved.
Returns:
The array of the retrieved attributes.
Throws:
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException : The object name in parameter is null or attributes in parameter is null.
See Also:
setAttributes(javax.management.AttributeList) sample code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList)

setAttribute sample code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute) definition code for javax.management.modelmbean.RequiredModelMBean.setAttribute(javax.management.Attribute)

public void setAttribute(Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  attribute)
                  throws AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException ,
                         InvalidAttributeValueException sample code for javax.management.InvalidAttributeValueException definition code for javax.management.InvalidAttributeValueException ,
                         MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                         ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Sets the value of a specific attribute of a named ModelMBean. If the 'setMethod' field of the attribute's descriptor contains the name of a valid operation descriptor, then the method described by the operation descriptor is executed. In this implementation, the operation descriptor must be specified correctly and assigned to the modelMBeanInfo so that the 'setMethod' works correctly. The response from the method is set as the value of the attribute in the descriptor.

If currencyTimeLimit is > 0, then the new value for the attribute is cached in the attribute descriptor's 'value' field and the 'lastUpdatedTimeStamp' field is set to the current time stamp.

If the persist field of the attribute's descriptor is not null then Persistence policy from the attribute descriptor is used to guide storing the attribute in a persistent store.
Store the MBean if 'persistPolicy' field is:

Do not store the MBean if 'persistPolicy' field is:

The ModelMBeanInfo of the Model MBean is stored in a file.

Specified by:
setAttribute sample code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) definition code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attribute - The Attribute instance containing the name of the attribute to be set and the value it is to be set to.
Throws:
AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException - The specified attribute is not accessible in the MBean.
The following cases may result in an AttributeNotFoundException:
  • No ModelMBeanAttributeInfo is found for the specified attribute.
  • The ModelMBeanAttributeInfo's isWritable method returns 'false'.
InvalidAttributeValueException sample code for javax.management.InvalidAttributeValueException definition code for javax.management.InvalidAttributeValueException - No descriptor is defined for the specified attribute.
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps one of the following Exceptions:
  • An Exception thrown by the managed object's setter.
  • A ServiceNotFoundException sample code for javax.management.ServiceNotFoundException definition code for javax.management.ServiceNotFoundException if no `setMethod` field is defined in the descriptor for the attribute or the managed resource is null.
  • InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException The 'targetType' field value is not 'objectReference'.
  • An Exception thrown by the managed object's getter.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps an Exception sample code for java.lang.Exception definition code for java.lang.Exception thrown while trying to invoke the setter.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException : The attribute in parameter is null.
See Also:
getAttribute(java.lang.String) sample code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.getAttribute(java.lang.String)

setAttributes sample code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.modelmbean.RequiredModelMBean.setAttributes(javax.management.AttributeList)

public AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  setAttributes(AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  attributes)
Sets the values of an array of attributes of this ModelMBean. Executes the setAttribute() method for each attribute in the list.

Specified by:
setAttributes sample code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The array of attributes that were set, with their new values in Attribute instances.
Throws:
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException : The object name in parameter is null or attributes in parameter is null.
See Also:
getAttributes(java.lang.String[]) sample code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[]) definition code for javax.management.modelmbean.RequiredModelMBean.getAttributes(java.lang.String[])

addNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

public void addNotificationListener(NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener,
                                    NotificationFilter sample code for javax.management.NotificationFilter definition code for javax.management.NotificationFilter  filter,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  handback)
                             throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
Registers an object which implements the NotificationListener interface as a listener. This object's 'handleNotification()' method will be invoked when any notification is issued through or by the ModelMBean. This does not include attributeChangeNotifications. They must be registered for independently.

Specified by:
addNotificationListener sample code for javax.management.NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) in interface NotificationBroadcaster sample code for javax.management.NotificationBroadcaster definition code for javax.management.NotificationBroadcaster
Parameters:
listener - The listener object which will handles notifications emitted by the registered MBean.
filter - The filter object. If null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener with the notification when a notification is emitted.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - The listener cannot be null.
See Also:
removeNotificationListener(javax.management.NotificationListener) sample code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener) definition code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener)

removeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener) definition code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener)

public void removeNotificationListener(NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener)
                                throws ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException 
Removes a listener for Notifications from the RequiredModelMBean.

Specified by:
removeNotificationListener sample code for javax.management.NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener) definition code for javax.management.NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener) in interface NotificationBroadcaster sample code for javax.management.NotificationBroadcaster definition code for javax.management.NotificationBroadcaster
Parameters:
listener - The listener name which was handling notifications emitted by the registered MBean. This method will remove all information related to this listener.
Throws:
ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException - The listener is not registered in the MBean or is null.
See Also:
addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) sample code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

removeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

public void removeNotificationListener(NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  listener,
                                       NotificationFilter sample code for javax.management.NotificationFilter definition code for javax.management.NotificationFilter  filter,
                                       Object sample code for java.lang.Object definition code for java.lang.Object  handback)
                                throws ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException 
Description copied from interface: NotificationEmitter sample code for javax.management.NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

Removes a listener from this MBean. The MBean must have a listener that exactly matches the given listener, filter, and handback parameters. If there is more than one such listener, only one is removed.

The filter and handback parameters may be null if and only if they are null in a listener to be removed.

Specified by:
removeNotificationListener sample code for javax.management.NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) definition code for javax.management.NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) in interface NotificationEmitter sample code for javax.management.NotificationEmitter definition code for javax.management.NotificationEmitter
Parameters:
listener - A listener that was previously added to this MBean.
filter - The filter that was specified when the listener was added.
handback - The handback that was specified when the listener was added.
Throws:
ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException - The listener is not registered with the MBean, or it is not registered with the given filter and handback.

sendNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendNotification(javax.management.Notification) definition code for javax.management.modelmbean.RequiredModelMBean.sendNotification(javax.management.Notification)

public void sendNotification(Notification sample code for javax.management.Notification definition code for javax.management.Notification  ntfyObj)
                      throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                             RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(javax.management.Notification) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(javax.management.Notification)
Sends a Notification which is passed in to the registered Notification listeners on the ModelMBean as a jmx.modelmbean.generic notification.

Specified by:
sendNotification sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(javax.management.Notification) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(javax.management.Notification) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
ntfyObj - The notification which is to be passed to the 'handleNotification' method of the listener object.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: The Notification object passed in parameter is null.

sendNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendNotification(java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.sendNotification(java.lang.String)

public void sendNotification(String sample code for java.lang.String definition code for java.lang.String  ntfyText)
                      throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                             RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(java.lang.String) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(java.lang.String)
Sends a Notification which contains the text string that is passed in to the registered Notification listeners on the ModelMBean.

Specified by:
sendNotification sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(java.lang.String) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendNotification(java.lang.String) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
ntfyText - The text which is to be passed in the Notification to the 'handleNotification' method of the listener object. the constructed Notification will be: type "jmx.modelmbean.generic" source this ModelMBean instance sequence 1
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: The Notification text string passed in parameter is null.

getNotificationInfo sample code for javax.management.modelmbean.RequiredModelMBean.getNotificationInfo() definition code for javax.management.modelmbean.RequiredModelMBean.getNotificationInfo()

public MBeanNotificationInfo sample code for javax.management.MBeanNotificationInfo definition code for javax.management.MBeanNotificationInfo [] getNotificationInfo()
Returns the array of Notifications always generated by the RequiredModelMBean.

RequiredModelMBean may always send also two additional notifications:

Thus these two notifications are always added to those specified by the application.

Specified by:
getNotificationInfo sample code for javax.management.NotificationBroadcaster.getNotificationInfo() definition code for javax.management.NotificationBroadcaster.getNotificationInfo() in interface NotificationBroadcaster sample code for javax.management.NotificationBroadcaster definition code for javax.management.NotificationBroadcaster
Returns:
MBeanNotificationInfo[]

addAttributeChangeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) definition code for javax.management.modelmbean.RequiredModelMBean.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)

public void addAttributeChangeNotificationListener(NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  inlistener,
                                                   String sample code for java.lang.String definition code for java.lang.String  inAttributeName,
                                                   Object sample code for java.lang.Object definition code for java.lang.Object  inhandback)
                                            throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                                                   RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException ,
                                                   IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)
Registers an object which implements the NotificationListener interface as a listener. This object's 'handleNotification()' method will be invoked when any attributeChangeNotification is issued through or by the ModelMBean. This does not include other Notifications. They must be registered for independently. An AttributeChangeNotification will be generated for this attributeName.

Specified by:
addAttributeChangeNotificationListener sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
inlistener - The listener object which will handles notifications emitted by the registered MBean.
inAttributeName - The name of the ModelMBean attribute for which to receive change notifications. If null, then all attribute changes will cause an attributeChangeNotification to be issued.
inhandback - The context to be sent to the listener with the notification when a notification is emitted.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException The attribute name passed in parameter does not exist.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - The listener cannot be null.
See Also:
ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)

removeAttributeChangeNotificationListener sample code for javax.management.modelmbean.RequiredModelMBean.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) definition code for javax.management.modelmbean.RequiredModelMBean.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)

public void removeAttributeChangeNotificationListener(NotificationListener sample code for javax.management.NotificationListener definition code for javax.management.NotificationListener  inlistener,
                                                      String sample code for java.lang.String definition code for java.lang.String  inAttributeName)
                                               throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                                                      RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException ,
                                                      ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)
Removes a listener for attributeChangeNotifications from the RequiredModelMBean.

Specified by:
removeAttributeChangeNotificationListener sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
inlistener - The listener name which was handling notifications emitted by the registered MBean. This method will remove all information related to this listener.
inAttributeName - The attribute for which the listener no longer wants to receive attributeChangeNotifications. If null the listener will be removed for all attributeChangeNotifications.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException If the inAttributeName parameter does not correspond to an attribute name.
ListenerNotFoundException sample code for javax.management.ListenerNotFoundException definition code for javax.management.ListenerNotFoundException - The listener is not registered in the MBean or is null.
See Also:
ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)

sendAttributeChangeNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) definition code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.AttributeChangeNotification)

public void sendAttributeChangeNotification(AttributeChangeNotification sample code for javax.management.AttributeChangeNotification definition code for javax.management.AttributeChangeNotification  ntfyObj)
                                     throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                                            RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.AttributeChangeNotification)
Sends an attributeChangeNotification which is passed in to the registered attributeChangeNotification listeners on the ModelMBean.

Specified by:
sendAttributeChangeNotification sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.AttributeChangeNotification) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
ntfyObj - The notification which is to be passed to the 'handleNotification' method of the listener object.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: The AttributeChangeNotification object passed in parameter is null.

sendAttributeChangeNotification sample code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) definition code for javax.management.modelmbean.RequiredModelMBean.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute)

public void sendAttributeChangeNotification(Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  inOldVal,
                                            Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  inNewVal)
                                     throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                                            RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException 
Description copied from interface: ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute)
Sends an attributeChangeNotification which contains the old value and new value for the attribute to the registered AttributeChangeNotification listeners on the ModelMBean.

Specified by:
sendAttributeChangeNotification sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster.sendAttributeChangeNotification(javax.management.Attribute, javax.management.Attribute) in interface ModelMBeanNotificationBroadcaster sample code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster definition code for javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Parameters:
inOldVal - The original value for the Attribute
inNewVal - The current value for the Attribute

  
 The constructed attributeChangeNotification will be:
   type        "jmx.attribute.change"
   source      this ModelMBean instance
   sequence    1
   attributeName oldValue.getName()
   attributeType oldValue's class
   attributeOldValue oldValue.getValue()
   attributeNewValue newValue.getValue()
 
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a distributed communication Exception.
RuntimeOperationsException sample code for javax.management.RuntimeOperationsException definition code for javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: An Attribute object passed in parameter is null or the names of the two Attribute objects in parameter are not the same.

getClassLoaderRepository sample code for javax.management.modelmbean.RequiredModelMBean.getClassLoaderRepository() definition code for javax.management.modelmbean.RequiredModelMBean.getClassLoaderRepository()

protected ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository  getClassLoaderRepository()
Return the Class Loader Repository used to perform class loading. Subclasses may wish to redefine this method in order to return the appropriate ClassLoaderRepository sample code for javax.management.loading.ClassLoaderRepository definition code for javax.management.loading.ClassLoaderRepository that should be used in this object.

Returns:
the Class Loader Repository.

preRegister sample code for javax.management.modelmbean.RequiredModelMBean.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.modelmbean.RequiredModelMBean.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

public ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  preRegister(MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server,
                              ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
                       throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Allows the MBean to perform any operations it needs before being registered in the MBean server. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBean server.

In order to ensure proper run-time semantics of RequireModelMBean, Any subclass of RequiredModelMBean overloading or overriding this method should call super.preRegister(server, name) in its own preRegister implementation.

Specified by:
preRegister sample code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
server - The MBean server in which the MBean will be registered.
name - The object name of the MBean. This name is null if the name parameter to one of the createMBean or registerMBean methods in the MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer interface is null. In that case, this method must return a non-null ObjectName for the new MBean.
Returns:
The name under which the MBean is to be registered. This value must not be null. If the name parameter is not null, it will usually but not necessarily be the returned value.
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException sample code for javax.management.MBeanRegistrationException definition code for javax.management.MBeanRegistrationException .

postRegister sample code for javax.management.modelmbean.RequiredModelMBean.postRegister(java.lang.Boolean) definition code for javax.management.modelmbean.RequiredModelMBean.postRegister(java.lang.Boolean)

public void postRegister(Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

In order to ensure proper run-time semantics of RequireModelMBean, Any subclass of RequiredModelMBean overloading or overriding this method should call super.postRegister(registrationDone) in its own postRegister implementation.

Specified by:
postRegister sample code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) definition code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed.

preDeregister sample code for javax.management.modelmbean.RequiredModelMBean.preDeregister() definition code for javax.management.modelmbean.RequiredModelMBean.preDeregister()

public void preDeregister()
                   throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Allows the MBean to perform any operations it needs before being unregistered by the MBean server.

In order to ensure proper run-time semantics of RequireModelMBean, Any subclass of RequiredModelMBean overloading or overriding this method should call super.preDeregister() in its own preDeregister implementation.

Specified by:
preDeregister sample code for javax.management.MBeanRegistration.preDeregister() definition code for javax.management.MBeanRegistration.preDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException sample code for javax.management.MBeanRegistrationException definition code for javax.management.MBeanRegistrationException .

postDeregister sample code for javax.management.modelmbean.RequiredModelMBean.postDeregister() definition code for javax.management.modelmbean.RequiredModelMBean.postDeregister()

public void postDeregister()
Allows the MBean to perform any operations needed after having been unregistered in the MBean server.

In order to ensure proper run-time semantics of RequireModelMBean, Any subclass of RequiredModelMBean overloading or overriding this method should call super.postDeregister() in its own postDeregister implementation.

Specified by:
postDeregister sample code for javax.management.MBeanRegistration.postDeregister() definition code for javax.management.MBeanRegistration.postDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration