com.adventnet.services.cascading
Class RemoteModelProxy

java.lang.Object
  extended by com.adventnet.services.cascading.RemoteModelProxy
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.modelmbean.ModelMBeanNotificationBroadcaster, javax.management.NotificationBroadcaster, javax.management.PersistentMBean

 class RemoteModelProxy
extends java.lang.Object
implements javax.management.DynamicMBean, javax.management.modelmbean.ModelMBean, javax.management.MBeanRegistration


Constructor Summary
RemoteModelProxy(Cascader casc, javax.management.ObjectName name)
           
 
Method Summary
 void addAttributeChangeNotificationListener(javax.management.NotificationListener inlistener, java.lang.String inAttributeName, java.lang.Object inhandback)
           
 void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Enables a couple (listener,handback) for a registered MBean to be added.
 java.lang.String findPersistent(java.lang.String MBeanName)
          Looks in the persistent store for this MBean to see if there is a persistent version of it.
 java.lang.Object getAttribute(java.lang.String attribute)
          Gets the value of a specific attribute of this MBean.
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
          Enables the values of several attributes of this MBean.
 javax.management.MBeanInfo getMBeanInfo()
          This method discovers the attributes and operations this MBean exposes for management.
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
          Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.
 java.lang.String getObjectName()
          Returns the ObjectName of this RemoteProxy with which it has been registered with the MBeanServer.
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
          Invokes an action on the original MBean associated with this MBean.
 void load()
          Locates the MBean in a persistent store and primes this instance of the MBean with the stored values.Any currently set values are overwritten.
 void postDeregister()
          Allows this MBean to perform any operations needed after having been de-registered in the MBeanServer.
 void postRegister(java.lang.Boolean registrationDone)
          Allows this MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
 void preDeregister()
          Allows this MBean to perform any operations it needs before being de-registered by the MBeanServer.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          Allows the MBean to perform any operations it needs before being registered in the MBeanServer.
 void removeAttributeChangeNotificationListener(javax.management.NotificationListener inlistener, java.lang.String inAttributeName)
           
 void removeNotificationListener(javax.management.NotificationListener listener)
          Enables a listener for an MBean to be removed.
 void sendAttributeChangeNotification(javax.management.Attribute inOldVal, javax.management.Attribute inNewVal)
           
 void sendAttributeChangeNotification(javax.management.AttributeChangeNotification ntfyObj)
           
 void sendNotification(javax.management.Notification ntfyObj)
           
 void sendNotification(java.lang.String ntfyText)
           
 void setAttribute(javax.management.Attribute attribute)
          Sets the value of a specific attribute of this MBean.
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
          Sets the values of several attributes of this MBean.
 void setManagedResource(java.lang.Object mr, 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(javax.management.modelmbean.ModelMBeanInfo mbi)
          Initializes a ModelMBean object using ModelMBeanInfo passed in.
 void store()
          Writes the MBean in a persistent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteModelProxy

public RemoteModelProxy(Cascader casc,
                        javax.management.ObjectName name)
Method Detail

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management.

Specified by:
getMBeanInfo in interface javax.management.DynamicMBean
Returns:
An instance of MBeanInfo allowing to retrieve all attributes and operations of this MBean.

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Gets the value of a specific attribute of this MBean.

Specified by:
getAttribute in interface javax.management.DynamicMBean
Parameters:
attribute - A String specifying the name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.
Throws:
javax.management.AttributeNotFoundException - The specified attribute is not accessible in the MBean.
javax.management.MBeanException - The constructor of the MBean has thrown an exception
javax.management.ReflectionException - Wraps a ClassNotFoundException or a java.lang.Exception that occured trying to invoke the MBean's constructor.

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Enables the values of several attributes of this MBean.

Specified by:
getAttributes in interface javax.management.DynamicMBean
Parameters:
attributes - A list of attributes to be retrieved.
Returns:
The value of the retrieved attributes as attributeList.

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Invokes an action on the original MBean associated with this MBean.

Specified by:
invoke in interface javax.management.DynamicMBean
Parameters:
actionName - The name of the action to be invoked.
params - An array containing the parameters to be set when the action is invoked
signature - An array containing the signature of the action. The class objects will be loaded using the same class loader as the one used for loading the MBean on which the action was invoked.
Returns:
The object returned by the action, which represents the result ofinvoking the action on the specified MBean.
Throws:
javax.management.MBeanException - The constructor of the MBean has thrown an exception
javax.management.ReflectionException - Wraps a ClassNotFoundException or a java.lang.Exception that occured trying to invoke the MBean's constructor.

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Sets the value of a specific attribute of this MBean.

Specified by:
setAttribute in interface javax.management.DynamicMBean
Parameters:
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
javax.management.AttributeNotFoundException - The specified attribute is not accessible in the MBean.
javax.management.InvalidAttributeValueException - The specified value for the attribute is not valid.
javax.management.MBeanException - The constructor of the MBean has thrown an exception
javax.management.ReflectionException - Wraps a ClassNotFoundException or a java.lang.Exception that occured trying to invoke the MBean's constructor.

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Sets the values of several attributes of this MBean.

Specified by:
setAttributes in interface 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 list of attributes that were set, with their new values.

getObjectName

public java.lang.String getObjectName()
Returns the ObjectName of this RemoteProxy with which it has been registered with the MBeanServer.

Returns:
the ObjectName

load

public void load()
          throws javax.management.MBeanException,
                 javax.management.RuntimeOperationsException,
                 javax.management.InstanceNotFoundException
Locates the MBean in a persistent store and primes this instance of the MBean with the stored values.Any currently set values are overwritten.

Specified by:
load in interface javax.management.PersistentMBean
Throws:
javax.management.MBeanException - The constructor of the MBean has thrown an exception
javax.management.RuntimeOperationsException - Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or the attribute in parameter is null.
javax.management.InstanceNotFoundException - The specified MBean is not registered in the MBeanServer.

store

public void store()
           throws javax.management.MBeanException,
                  javax.management.RuntimeOperationsException,
                  javax.management.InstanceNotFoundException
Writes the MBean in a persistent store.

Specified by:
store in interface javax.management.PersistentMBean
Throws:
javax.management.MBeanException - The constructor of the MBean has thrown an exception
javax.management.RuntimeOperationsException - Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or the attribute in parameter is null.
javax.management.InstanceNotFoundException - The specified MBean is not registered in the MBeanServer.

findPersistent

public java.lang.String findPersistent(java.lang.String MBeanName)
                                throws java.lang.Exception
Looks in the persistent store for this MBean to see if there is a persistent version of it.

Parameters:
MBeanName - The name of the MBean.
Returns:
String the specific MBeanName found.
Throws:
java.langException - - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException
java.lang.Exception

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Allows the MBean to perform any operations it needs before being registered in the MBeanServer. 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 MBeanServer.

Specified by:
preRegister in interface javax.management.MBeanRegistration
Parameters:
server - The MBeanServer in which the MBean will be registered.
name - The object name of the MBean.
Returns:
The name of the MBean registered.
Throws:
java.lang.Exception - - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Allows this MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.

Specified by:
postRegister in interface javax.management.MBeanRegistration
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBeanServer. The value false means that either the registration phase has failed.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Allows this MBean to perform any operations it needs before being de-registered by the MBeanServer.

Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.langException - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.
java.lang.Exception

postDeregister

public void postDeregister()
Allows this MBean to perform any operations needed after having been de-registered in the MBeanServer.

Specified by:
postDeregister in interface javax.management.MBeanRegistration

setManagedResource

public void setManagedResource(java.lang.Object mr,
                               java.lang.String mr_type)
                        throws javax.management.MBeanException,
                               javax.management.RuntimeOperationsException,
                               javax.management.InstanceNotFoundException,
                               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 in interface 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, RMIReference. If the MBeanServer cannot process the mr_type passed in, an InvalidTargetTypeException will be thrown.
Throws:
javax.management.MBeanException - The initializer of the object has thrown an exception.
javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: The managed resource or managed resoure type passed in parameter is null or invalid.
javax.management.InstanceNotFoundException - The managed resource object could not be found.
javax.management.InvalidTargetObjectTypeException - The managed resource type cannot be processed by the ModelMBean or JMX Agent.
javax.management.modelmbean.InvalidTargetObjectTypeException

setModelMBeanInfo

public void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo mbi)
                       throws javax.management.MBeanException,
                              javax.management.RuntimeOperationsException
Initializes a ModelMBean object using ModelMBeanInfo passed in. The ModelMBean must be instantiated, but not registered with the MBeanServer. After the ModelMBean's ModelMBeanInfo (with Descriptors) are customized, the ModelMBean should be registered with the MBeanServer.

Specified by:
setModelMBeanInfo in interface javax.management.modelmbean.ModelMBean
Parameters:
inModelMBeanInfo - - The ModelMBeanInfo object to be used by the ModelMBean.
Throws:
javax.management.MBeanException - The constructor of the MBeanInfo has return null or thrown an exception.
javax.management.RuntimeOperationsException - Wraps an IllegalArgumentException: The MBeanInfo passed in parameter is null or invalid.

addNotificationListener

public void addNotificationListener(javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws java.lang.IllegalArgumentException
Enables a couple (listener,handback) for a registered MBean to be added.

Specified by:
addNotificationListener in interface javax.management.NotificationBroadcaster
Parameters:
listener - The listener object which will handles notifications emitted by the registered MBean.
filter - The filter object. If not specified, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.
Throws:
java.lang.IllegalArgumentException

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener)
                                throws javax.management.ListenerNotFoundException
Enables a listener for an MBean to be removed. All couple (listener, handback) are removed.

Specified by:
removeNotificationListener in interface javax.management.NotificationBroadcaster
Parameters:
listener - - The listener object which will handles notifications emitted by the registered MBean.
Throws:
javax.management.ListenerNotFoundException - The couple (listener,handback) is not registered in the MBean. The exception message contains either "listener", "handback" or the object name depending on which object cannot be found.

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.

Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Returns:
A NotificationInfo object

addAttributeChangeNotificationListener

public void addAttributeChangeNotificationListener(javax.management.NotificationListener inlistener,
                                                   java.lang.String inAttributeName,
                                                   java.lang.Object inhandback)
                                            throws javax.management.MBeanException,
                                                   javax.management.RuntimeOperationsException,
                                                   java.lang.IllegalArgumentException
Specified by:
addAttributeChangeNotificationListener in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException
java.lang.IllegalArgumentException

removeAttributeChangeNotificationListener

public void removeAttributeChangeNotificationListener(javax.management.NotificationListener inlistener,
                                                      java.lang.String inAttributeName)
                                               throws javax.management.MBeanException,
                                                      javax.management.RuntimeOperationsException,
                                                      javax.management.ListenerNotFoundException
Specified by:
removeAttributeChangeNotificationListener in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException
javax.management.ListenerNotFoundException

sendNotification

public void sendNotification(javax.management.Notification ntfyObj)
                      throws javax.management.MBeanException,
                             javax.management.RuntimeOperationsException
Specified by:
sendNotification in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException

sendNotification

public void sendNotification(java.lang.String ntfyText)
                      throws javax.management.MBeanException,
                             javax.management.RuntimeOperationsException
Specified by:
sendNotification in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException

sendAttributeChangeNotification

public void sendAttributeChangeNotification(javax.management.AttributeChangeNotification ntfyObj)
                                     throws javax.management.MBeanException,
                                            javax.management.RuntimeOperationsException
Specified by:
sendAttributeChangeNotification in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException

sendAttributeChangeNotification

public void sendAttributeChangeNotification(javax.management.Attribute inOldVal,
                                            javax.management.Attribute inNewVal)
                                     throws javax.management.MBeanException,
                                            javax.management.RuntimeOperationsException
Specified by:
sendAttributeChangeNotification in interface javax.management.modelmbean.ModelMBeanNotificationBroadcaster
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException