com.sun.jdmk.comm
Class GenericHttpConnectorClient

java.lang.Object
  extended by com.sun.jdmk.comm.GenericHttpConnectorClient
All Implemented Interfaces:
ClientNotificationHandler, HeartBeatClientHandler, RemoteMBeanServer, NotificationRegistration, ProxyHandler, Serializable
Direct Known Subclasses:
HttpConnectorClient, HttpsConnectorClient

Deprecated. The JMX Remote API should be used in preference to the legacy Java DMK connector classes. This class may be removed in a future version of Java DMK. See JdmkLegacyConnector.

public abstract class GenericHttpConnectorClient
extends Object
implements RemoteMBeanServer, HeartBeatClientHandler, Serializable

The GenericHttpConnectorClient class provides an implementation of the RemoteMBeanServer interface based on the HTTP protocol.

Querying a Java Dynamic Management agent with the HTTP connector implies that an instance of GenericHttpConnectorServer is running on the remote Java Dynamic Management agent.

In order to identify the Java Dynamic Management agent the connector needs to communicate with, the method connect needs to be invoked.

It is possible to request the use of a specific proxy through the java properties http.proxyHost=host and http.proxyPort=port for HTTP, and https.proxyHost=host and https.proxyPort=port for HTTPS.

The authentication information required to configure the connector is provided by the ConnectorAddress parameter in the method connect.

The following port numbers are used by default:

This class implements the ClientNotificationHandler interface to receive notifications from a remote MBean, and the HeartBeatClientHandler interface to be able to detect any communication problem with the connector server and notify it to the manager that created it.

See Also:
RemoteMBeanServer, HeartBeatClientHandler, GenericHttpConnectorServer, Serialized Form

Field Summary
 
Fields inherited from interface com.sun.jdmk.comm.ClientNotificationHandler
DISCARD_NEW, DISCARD_OLD, NO_CACHE_LIMIT, PULL_MODE, PUSH_MODE
 
Constructor Summary
GenericHttpConnectorClient()
          Deprecated. Constructs a connector client.
GenericHttpConnectorClient(InetAddress addr)
          Deprecated. Constructs a connector client.
GenericHttpConnectorClient(String addr)
          Deprecated. Constructs a connector client.
 
Method Summary
 void addHeartBeatNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          Deprecated. Adds the specified heartbeat listener to receive heartbeat notifications from this connector client.
 void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Deprecated. Adds a listener to a registered MBean.
 void clearCache()
          Deprecated. Clear the notification cache.
 String connect(ConnectorAddress mbeanServerAddress)
          Deprecated. Initializes the communication with the remote MBeanServer.
 ObjectInstance createMBean(String className, ObjectName name)
          Deprecated. Creates an registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 void disconnect()
          Deprecated. Terminates the communication with the MBeanServer.
 void disconnect(boolean local)
          Deprecated. Terminates the communication with the MBeanServer.
 Object getAttribute(ObjectName name, String attribute)
          Deprecated. Gets the value of a specific attribute of a named MBean.
 AttributeList getAttributes(ObjectName name, String[] attributes)
          Deprecated. Allows to retrieve the values of several attributes of an MBean.
 int getCacheSize()
          Deprecated. Get the cache size of notifications waiting to be forwarded.
 String getClassForProxyMBean(ObjectInstance instance)
          Deprecated. Given the object name and the Java class name of the MBean(ObjectInstance), this method returns the name of the Java class of the corresponding ProxyMBean.
 String getDefaultDomain()
          Deprecated. Returns the default domain used for the MBean naming.
 int getHeartBeatPeriod()
          Deprecated. Gets the heartbeat period in milliseconds.
 int getHeartBeatRetries()
          Deprecated. Gets the number of retries.
 Integer getMBeanCount()
          Deprecated. Returns the number of MBeans controlled by the MBeanServer.
 MBeanInfo getMBeanInfo(ObjectName name)
          Deprecated. This method supplies the exposed attributes and actions of the MBean.
 ConnectorAddress getMBeanServerAddress()
          Deprecated. Returns the exact address of the MBeanServer to which the ConnectorClient is connected.
 String getMBeanServerId()
          Deprecated. Return a string which represents the MBeanServer identification.
 int getMode()
          Deprecated. Gets the notification forwarding mode.
 void getNotifications()
          Deprecated. Retrieves all notifications in the cache.
 ObjectInstance getObjectInstance(ObjectName name)
          Deprecated. Gets the ObjectInstance for a given MBean registered with the MBeanServer.
 OperationContext getOperationContext()
          Deprecated. Get the OperationContext that was last given to setOperationContext, or null if setOperationContext was never called.
 int getOverflowCount()
          Deprecated. Get the number of notifications discarded since last forwarding because the cache limit has been reached.
 int getOverflowMode()
          Deprecated. Returns whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.
 int getPeriod()
          Deprecated. Gets the period for notification forwarding in milliseconds.
 Object invoke(ObjectName name, String methodName, Object[] arguments, String[] signature)
          Deprecated. Invokes a method of an MBean.
 boolean isConnected()
          Deprecated. Checks whether a communication with the MBeanServer is established.
 boolean isInstanceOf(ObjectName name, String className)
          Deprecated. Returns true if the MBean specified is an instance of the specified class, false otherwise.
 boolean isRegistered(ObjectName name)
          Deprecated. Checks whether an MBean, identified by its object name, is already registered with the MBeanServer.
 Set queryMBeans(ObjectName name, QueryExp query)
          Deprecated. Gets MBeans controlled by the MBeanServer.
 Set queryNames(ObjectName name, QueryExp query)
          Deprecated. Gets the names of MBeans controlled by the MBeanServer.
 void removeHeartBeatNotificationListener(NotificationListener listener)
          Deprecated. Removes the specified heartbeat listener so that it no longer receives heartbeat notifications from this connector client.
 void removeNotificationListener(ObjectName name, NotificationListener listener)
          Deprecated. Removes a listener from a registered MBean.
 void setAttribute(ObjectName name, Attribute attribute)
          Deprecated. Sets the value of a specific attribute of a named MBean.
 AttributeList setAttributes(ObjectName name, AttributeList attributes)
          Deprecated. Allows to modify the values of several attributes of an MBean.
 int setCacheSize(int size, boolean discardOverflow)
          Deprecated. Set the cache size of notifications waiting to be forwarded.
 void setHeartBeatPeriod(int period)
          Deprecated. Specifies the heartbeat period in milliseconds.
 void setHeartBeatRetries(int nretries)
          Deprecated. Sets the number of retries.
 void setMode(int mode)
          Deprecated. Sets the notification forwarding mode, it is the agent to push notifications to the client, if set to PULL_MODE, it is the client to retrieve notifications from the agent.
 void setOperationContext(OperationContext c)
          Deprecated. Set the OperationContext of this connector.
 void setOverflowCount(int count)
          Deprecated. Sets the number of notifications discarded, this number indicates the number of notifications discarded because the cache limit has been reached.
 void setOverflowMode(int of)
          Deprecated. Specify whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.
 void setPeriod(int period)
          Deprecated. Specifies the period for notification forwarding in milliseconds.
 boolean supports(String feature)
          Deprecated. Returns true if the connector server supports the given feature, false otherwise.
 void unregisterMBean(ObjectName name)
          Deprecated. Deletes an instance of an MBean in the remote MBean server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericHttpConnectorClient

public GenericHttpConnectorClient()
Deprecated. 
Constructs a connector client.

This constructor will send the default local host name to a server for receiving notifications.


GenericHttpConnectorClient

public GenericHttpConnectorClient(InetAddress addr)
Deprecated. 
Constructs a connector client.

Parameters:
addr - local address sent to a server for receiving notifications. This address will be saved internally using InetAddress.getHostAddress.
Since:
Java DMK 5.0

GenericHttpConnectorClient

public GenericHttpConnectorClient(String addr)
Deprecated. 
Constructs a connector client.

Parameters:
addr - local address sent to a server for receiving notifications.
Since:
Java DMK 5.0
Method Detail

setOperationContext

public void setOperationContext(OperationContext c)
Deprecated. 

Set the OperationContext of this connector. This context will be sent along with each request and can be recovered by the server, which can make it available to the operations it invokes.

The saved OperationContext will be a clone of the object c made using its clone method.

Specified by:
setOperationContext in interface RemoteMBeanServer
Parameters:
c - the new OperationContext. It may be null to indicate that there is no context. The previous OperationContext, if any, is lost.
Throws:
CommunicationException - if the context cannot be set for some reason. One common reason is that the object c does not implement the Cloneable interface.

getOperationContext

public OperationContext getOperationContext()
Deprecated. 
Get the OperationContext that was last given to setOperationContext, or null if setOperationContext was never called.

Specified by:
getOperationContext in interface RemoteMBeanServer
Returns:
the current OperationContext.

connect

public String connect(ConnectorAddress mbeanServerAddress)
Deprecated. 
Initializes the communication with the remote MBeanServer. All the information needed for identifying the MBeanServer to contact and the protocol to be used is contained in the object of type ConnectorAddress passed as a parameter. If a communication problem occurs this method will throw a CommunicationException (JMRuntimeException). If the RemoteMBeanServer had already been connected to and disconnected from an MBeanServer identified by its MBeanServerId, and if the MBeanServer reachable by the MBeanServerAddress parameter doesn't have the same MBeanServerId, then java.lang.IllegalAccessException is thrown.

Specified by:
connect in interface RemoteMBeanServer
Parameters:
mbeanServerAddress - The address for the MBeanServer to contact (MBeanServer identification, protocol specification).
Returns:
A String identifying the MBeanServer with which the communication is established.
Throws:
IllegalArgumentException - The RemoteMBeanServer has already been connected and disconnected and the specified ConnectorAddress doesn't identify the same MBeanServer.
CommunicationException - The RemoteMBeanServer was already connected or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

disconnect

public void disconnect()
Deprecated. 
Description copied from interface: RemoteMBeanServer
Terminates the communication with the MBeanServer.

Specified by:
disconnect in interface RemoteMBeanServer

disconnect

public void disconnect(boolean local)
Deprecated. 
Terminates the communication with the MBeanServer.


isConnected

public boolean isConnected()
Deprecated. 
Checks whether a communication with the MBeanServer is established.

Specified by:
isConnected in interface RemoteMBeanServer
Returns:
True, if the communication is established, otherwise false.

getMBeanServerAddress

public ConnectorAddress getMBeanServerAddress()
Deprecated. 
Returns the exact address of the MBeanServer to which the ConnectorClient is connected. The address is of type ConnectorAddress.

Specified by:
getMBeanServerAddress in interface RemoteMBeanServer
Returns:
The exact address of the remote MBeanServer, or null if the ConnectorClient is not connected.

getMBeanServerId

public String getMBeanServerId()
Deprecated. 
Return a string which represents the MBeanServer identification. This String comes from the MBeanServerDelegate MBean. If the Connector Client hasn't been connected yet, it returns null. If the connector Client has been connected and disconnected, getMbeanServerId still returns the previous MbeanServer identification.

Specified by:
getMBeanServerId in interface RemoteMBeanServer
Returns:
If the Connector Client has not been connected yet, it returns null. If the connector Client has been connected and disconnected, getMbeanServerId still returns the previous MbeanServer identification.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Deprecated. 
Creates an registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. It returns an ObjectInstance representing the remote MBean created.

Specified by:
createMBean in interface RemoteMBeanServer
Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not an JMX compliant MBean
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. You can optionally provide the name of the class loader to be used. It returns an ObjectInstance representing the remote MBean created.

Specified by:
createMBean in interface RemoteMBeanServer
Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
loaderName - The name of the class loader to be used by the MBeanServer.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not an JMX compliant MBean
InstanceNotFoundException - The specified loader is not registered in the MBeanServer
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. It returns an ObjectInstance representing the remote MBean created.

Specified by:
createMBean in interface RemoteMBeanServer
Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
params - An array containing the parameters of the constructor to be invoked. A parameter can be any Java object that is serializable.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not an JMX compliant MBean
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. You can optionally provide the name of the class loader to be used. It returns an ObjectInstance representing the remote MBean created.

Specified by:
createMBean in interface RemoteMBeanServer
Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
loaderName - The name of the class loader to be used by the MBeanServer.
params - An array containing the parameters of the constructor to be invoked. A parameter can be any Java object that is serializable.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not an JMX compliant MBean
InstanceNotFoundException - The specified loader is not registered in the MBeanServer
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

unregisterMBean

public void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException
Deprecated. 
Deletes an instance of an MBean in the remote MBean server. It also removes its local proxy (ProxyMBean and/or GenericProxy) object from the ProxyFactory.

Specified by:
unregisterMBean in interface RemoteMBeanServer
Specified by:
unregisterMBean in interface ProxyHandler
Parameters:
name - The name of the MBean to be deleted.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
MBeanRegistrationException - The preDeregister (MBeanRegistration interface) method of the MBean has thrown an exception.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

queryNames

public Set queryNames(ObjectName name,
                      QueryExp query)
Deprecated. 
Gets the names of MBeans controlled by the MBeanServer. This method allows any of the following to be obtained: The names of all MBeans, the names of a set of MBeans specified by pattern matching on the ObjectName and/or a Query expression, a specific MBean name (equivalent to testing whether an MBean is registered). When the object name is null or empty, all the objects are to be selected (and filtered if a query is specified). It returns the set of ObjectNames for the MBeans selected.

Specified by:
queryNames in interface RemoteMBeanServer
Parameters:
name - The object name pattern identifying the MBean names to be retrieved. If null or empty, the names of all the registered MBeans will be retrieved.
query - The query expression to be applied for selecting MBeans.
Returns:
A set containing the ObjectNames for the MBeans selected.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

queryMBeans

public Set queryMBeans(ObjectName name,
                       QueryExp query)
Deprecated. 
Gets MBeans controlled by the MBeanServer. This method allows any of the following to be obtained: All MBeans, a set of MBeans specified by pattern matching on the ObjectName and/or a Query expression, a specific MBean. When the object name is null or empty, all objects are to be selected (and filtered if a query is specified). It returns the set of ObjectInstances (containing the ObjectName and the Java Class name) for the selected MBeans.

Specified by:
queryMBeans in interface RemoteMBeanServer
Parameters:
name - The object name pattern identifying the MBeans to be retrieved. If null or empty all the MBeans registered will be retrieved.
query - The query expression to be applied for selecting MBeans.
Returns:
A set containing the ObjectInstances for the MBeans selected.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

isRegistered

public boolean isRegistered(ObjectName name)
Deprecated. 
Checks whether an MBean, identified by its object name, is already registered with the MBeanServer.

Specified by:
isRegistered in interface RemoteMBeanServer
Parameters:
name - The object name of the MBean to be checked.
Returns:
True if the MBean is already registered in the MBeanServer, false otherwise.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getAttribute

public Object getAttribute(ObjectName name,
                           String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException
Deprecated. 
Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

Specified by:
getAttribute in interface RemoteMBeanServer
Specified by:
getAttribute in interface ProxyHandler
Parameters:
name - The object name of the MBean from which the attribute is to be retrieved.
attribute - The name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute. The return value can be any Java object that is serializable.
Throws:
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
MBeanException - Wraps an exception thrown by the MBean's getter.
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
ReflectionException - Wraps an exception thrown while trying to instantiate and apply the operator specified in Modification.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getAttributes

public AttributeList getAttributes(ObjectName name,
                                   String[] attributes)
                            throws InstanceNotFoundException
Deprecated. 
Allows to retrieve the values of several attributes of an MBean.

Specified by:
getAttributes in interface RemoteMBeanServer
Specified by:
getAttributes in interface ProxyHandler
Parameters:
name - The object name of the MBean from within which the attributes are to be retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The values of the attributes retrieved. The value of the attributes can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setAttribute

public void setAttribute(ObjectName name,
                         Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Deprecated. 
Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

Specified by:
setAttribute in interface RemoteMBeanServer
Specified by:
setAttribute in interface ProxyHandler
Parameters:
name - The name of the MBean within which the attribute is to be set.
attribute - The modification to be performed: The identification of the attribute to be set, the value it is to be set to, and the operator to apply. The value of the attribute can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
InvalidAttributeValueException - The specified value for the attribute is not valid.
MBeanException - Wraps an exception thrown by the MBean's setter.
ReflectionException - Wraps an exception thrown while trying to instantiate and apply the operator specified in Modification.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setAttributes

public AttributeList setAttributes(ObjectName name,
                                   AttributeList attributes)
                            throws InstanceNotFoundException
Deprecated. 
Allows to modify the values of several attributes of an MBean.

Specified by:
setAttributes in interface RemoteMBeanServer
Specified by:
setAttributes in interface ProxyHandler
Parameters:
name - The object name of the MBean from within which the attributes are to be set.
attributes - A list of the attributes to be set, their values and, optionally, the operators to apply. The value of the attributes can be any Java object that is serializable.
Returns:
The values of the attributes that were set. The value of the attributes can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

invoke

public Object invoke(ObjectName name,
                     String methodName,
                     Object[] arguments,
                     String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException
Deprecated. 
Invokes a method of an MBean.

Specified by:
invoke in interface RemoteMBeanServer
Specified by:
invoke in interface ProxyHandler
Parameters:
name - The name of the MBean on which the method is to be invoked.
methodName - The name of the method to be invoked.
arguments - An array containing the arguments to be set when the method is invoked. An argument can be any Java object that is serializable.
signature - An array containing the signature of the method.
Returns:
The object returned by the invocation of the given method. The return value can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
MBeanException - Wraps an exception thrown by the MBean's invoked method.
ReflectionException - Wraps an java.lang.Exception thrown while trying to invoke the method.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException
Deprecated. 
This method supplies the exposed attributes and actions of the MBean. It provides this information using an MBeanInfo object.

Specified by:
getMBeanInfo in interface RemoteMBeanServer
Specified by:
getMBeanInfo in interface ProxyHandler
Parameters:
name - The name of the MBean whose attributes and actions will be returned.
Returns:
An instance of MBeanInfo which allows all methods and actions of this MBean to be retrieved.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
IntrospectionException - An exception occurs during introspection.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the getMBeanInfo method.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException
Deprecated. 
Gets the ObjectInstance for a given MBean registered with the MBeanServer.

Specified by:
getObjectInstance in interface RemoteMBeanServer
Parameters:
name - The object name of the MBean.
Returns:
The ObjectInstance associated to the MBean specified by name.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBeanServer.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getMBeanCount

public Integer getMBeanCount()
Deprecated. 
Returns the number of MBeans controlled by the MBeanServer.

Specified by:
getMBeanCount in interface RemoteMBeanServer
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getDefaultDomain

public String getDefaultDomain()
Deprecated. 
Returns the default domain used for the MBean naming.

Specified by:
getDefaultDomain in interface RemoteMBeanServer
Returns:
The default domain used by the MBeanServer.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

isInstanceOf

public boolean isInstanceOf(ObjectName name,
                            String className)
                     throws InstanceNotFoundException
Deprecated. 
Returns true if the MBean specified is an instance of the specified class, false otherwise.

Specified by:
isInstanceOf in interface RemoteMBeanServer
Parameters:
name - The ObjectName of the MBean.
className - The name of the class.
Returns:
true if the MBean specified is an instance of the specified class, false otherwise.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.

supports

public boolean supports(String feature)
Deprecated. 
Returns true if the connector server supports the given feature, false otherwise.


getClassForProxyMBean

public String getClassForProxyMBean(ObjectInstance instance)
                             throws ProxyMBeanInstantiationException
Deprecated. 
Given the object name and the Java class name of the MBean(ObjectInstance), this method returns the name of the Java class of the corresponding ProxyMBean. The returned name can be null, if there is no Java class corresponding to the needed ProxyMBean.

Specified by:
getClassForProxyMBean in interface RemoteMBeanServer
Parameters:
instance - The ObjectInstance (ObjectName, Java class name) of the MBean which is represented by the ProxyMBean.
Returns:
The name of the Java class of the ProxyMBean.
Throws:
ProxyMBeanInstantiationException

setMode

public void setMode(int mode)
             throws IllegalArgumentException
Deprecated. 
Sets the notification forwarding mode, it is the agent to push notifications to the client, if set to PULL_MODE, it is the client to retrieve notifications from the agent.

The default value is PUSH_MODE.

Specified by:
setMode in interface ClientNotificationHandler
Parameters:
mode - set to PUSH_MODE or PULL_MODE.
Throws:
IllegalArgumentException - Thrown if the mode is not equal to PUSH_MODE nor PULL_MODE.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getMode

public int getMode()
Deprecated. 
Gets the notification forwarding mode. If set to PUSH_MODE, it is the agent to push notifications to the client, if set to PULL_MODE, it is the client to retrieve notifications from the agent.

The default value is PUSH_MODE.

Specified by:
getMode in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getNotifications

public void getNotifications()
Deprecated. 
Retrieves all notifications in the cache.

Specified by:
getNotifications in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setPeriod

public void setPeriod(int period)
Deprecated. 
Specifies the period for notification forwarding in milliseconds.

If set to equal to or less than zero and the pull mode is used, no pull will be done. A user should explicitly call getNotifications to retrieve all notifications in the cache. This method has no effect in the push mode in the current implementation.

The default value is 1000 milliseconds.

Specified by:
setPeriod in interface ClientNotificationHandler
Parameters:
period - The period in milliseconds.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getPeriod

public int getPeriod()
Deprecated. 
Gets the period for notification forwarding in milliseconds.

The default value is 1000 milliseconds.

Specified by:
getPeriod in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

clearCache

public void clearCache()
Deprecated. 
Clear the notification cache. All notifications saved in the cache then will be discarded without being sent.

Specified by:
clearCache in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setCacheSize

public int setCacheSize(int size,
                        boolean discardOverflow)
                 throws JMRuntimeException
Deprecated. 
Set the cache size of notifications waiting to be forwarded.

If set to NO_CACHE_LIMIT, notifications will never be discarded, but this may lead to OutOfMemory errors under stressed conditions. If set to zero, any notification will be discarded without being sent.

The default value is NO_CACHE_LIMIT.

Specified by:
setCacheSize in interface ClientNotificationHandler
Parameters:
size - the maximum number of notifications in the cache.
discardOverflow - effective only if current number of cached notifications exceeds the new size: if true, discard excess notifications; if false, the cache size will not be changed.
Returns:
The cache size currently set.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.
JMRuntimeException

getCacheSize

public int getCacheSize()
Deprecated. 
Get the cache size of notifications waiting to be forwarded.

If set to NO_CACHE_LIMIT or a negative value, notifications will never be discarded, but this may lead to OutOfMemory errors under stressed conditions.

The default value is NO_CACHE_LIMIT.

Specified by:
getCacheSize in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setOverflowCount

public void setOverflowCount(int count)
Deprecated. 
Sets the number of notifications discarded, this number indicates the number of notifications discarded because the cache limit has been reached.

This count will be reset to zero if no more listener exists at the client side, because in this case the notification server will remove all information about this notification client.

Specified by:
setOverflowCount in interface ClientNotificationHandler
Parameters:
count - The new value to set to overflow count.
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getOverflowCount

public int getOverflowCount()
Deprecated. 
Get the number of notifications discarded since last forwarding because the cache limit has been reached. This value can be reset by calling the method setOverflowCount.

This count will be reset to zero if no more listener exists at the client side, because in this case the notification server will remove all information about this notification client.

Specified by:
getOverflowCount in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

setOverflowMode

public void setOverflowMode(int of)
                     throws IllegalArgumentException
Deprecated. 
Specify whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.

The default mode is DISCARD_OLD.

Specified by:
setOverflowMode in interface ClientNotificationHandler
Parameters:
of - The overflow mode to specify.
Throws:
IllegalArgumentException - Thrown if the mode is not DISCARD_NEW nor DISCARD_OLD.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getOverflowMode

public int getOverflowMode()
Deprecated. 
Returns whether to discard the oldest message (DISCARD_OLD) or the the newest message (DISCARD_NEW), if the cache size exceeds.

The default mode is DISCARD_OLD.

Specified by:
getOverflowMode in interface ClientNotificationHandler
Throws:
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws InstanceNotFoundException
Deprecated. 
Adds a listener to a registered MBean.

Specified by:
addNotificationListener in interface NotificationRegistration
Parameters:
name - The name of the MBean on which the listener should be added.
listener - The listener object which will handle the notifications emitted by the registered MBean.
filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Deprecated. 
Removes a listener from a registered MBean.

Specified by:
removeNotificationListener in interface NotificationRegistration
Parameters:
name - The name of the MBean on which the listener should be removed.
listener - The listener object which will handle the notifications emitted by the registered MBean. This method will remove all the information related to this listener.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean.
CommunicationException - The connector client is not connected to connector server or a problem was encountered in the connection to the connector server.
UnauthorizedSecurityException - The authentication information sent to the ConnectorServer was not correct. Login based authentication failed.

getHeartBeatPeriod

public int getHeartBeatPeriod()
Deprecated. 
Gets the heartbeat period in milliseconds.

The default value is 10000 milliseconds.

Specified by:
getHeartBeatPeriod in interface HeartBeatClientHandler

setHeartBeatPeriod

public void setHeartBeatPeriod(int period)
Deprecated. 
Specifies the heartbeat period in milliseconds.

If set to zero no check will be carried out for the associated connector server being alive. As the heartbeat is driven by the manager this would also prevent the connector server from being aware of the aliveness of this connector client.

The default value is 10000 milliseconds.

Specified by:
setHeartBeatPeriod in interface HeartBeatClientHandler
Parameters:
period - The heartbeat period in milliseconds.

getHeartBeatRetries

public int getHeartBeatRetries()
Deprecated. 
Gets the number of retries. This number specifies how many times a connector client must retry the connection to the connector server before sending the heartbeat notification indicating that the connector server has died. If number of retries equals zero then no retries are carried out.

The default value is 6 times.

Specified by:
getHeartBeatRetries in interface HeartBeatClientHandler

setHeartBeatRetries

public void setHeartBeatRetries(int nretries)
Deprecated. 
Sets the number of retries. This number specifies how many times a connector client must retry the connection to the connector server before sending the heartbeat notification indicating that the connector server has died. If number of retries equals zero then no retries are carried out.

The default value is 6 times.

Specified by:
setHeartBeatRetries in interface HeartBeatClientHandler
Parameters:
nretries - The number of retries.

addHeartBeatNotificationListener

public void addHeartBeatNotificationListener(NotificationListener listener,
                                             NotificationFilter filter,
                                             Object handback)
Deprecated. 
Adds the specified heartbeat listener to receive heartbeat notifications from this connector client. Heartbeat notifications occur when the connector client connects to or disconnects from the connector server or when the connector server associated to this connector client dies or is temporarily unreachable.

Specified by:
addHeartBeatNotificationListener in interface HeartBeatClientHandler
Parameters:
listener - The heartbeat listener which will handle the notifications emitted by the connector client.
filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.

removeHeartBeatNotificationListener

public void removeHeartBeatNotificationListener(NotificationListener listener)
Deprecated. 
Removes the specified heartbeat listener so that it no longer receives heartbeat notifications from this connector client. Heartbeat notifications occur when the connector client connects to or disconnects from the connector server or when the connector server associated to this connector client dies or is temporarily unreachable.

Specified by:
removeHeartBeatNotificationListener in interface HeartBeatClientHandler
Parameters:
listener - The heartbeat listener which will handle the notifications emitted by the connector client.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.