Sonic Management API

com.sonicsw.mf.jmx.client
Class JMSConnectorClient

java.lang.Object
  extended by com.sonicsw.mf.jmx.client.JMSConnectorClient
All Implemented Interfaces:
IRemoteMBeanServer, MBeanServerConnection

public class JMSConnectorClient
extends java.lang.Object
implements IRemoteMBeanServer

A JMS Connector uses the SonicMQ JMS implementation to provide JMX Connector functionality. Since the JMS Connector enables a single connection point for management communications to multiple JMX servers, a JMS address can indicate either the connector should be dedicated to a particular MBeanServer ("bound") or capable of addressing multiple servers ("unbound") (acheived through JMX domain & ObjectName patterns).

JMS Connector Clients are designed to be used exclusively with the Sonic Management containers and components which expose themselves using JMX and the Sonic Management JMX domain & ObjectName patterns. In an unbounded mode, JMX ObjectNames must reflect the said patterns otherwise remote calls will timeout.

Sonic Management JMX ObjectName patterns are of the form "<SM domain>.<SM container name>:ID=<SM component name>".

The JMS Connector client exposes MBean server methods suitable for remoting. If the JMS Connector is not dedicated to a particular MBean server ("unbound"), MBean server methods that are MBean server specific (e.g. such as getDefaultDomain()) will throw an exception when called. Remote support is indicated in the documentation for each method.

The JMSConnectorClient wraps all unreported exceptions/error in a CommunicationException.

Unlike other JMX connectors, the default connector connect behavior is to wait for a connection to be established. Using the connect(JMSConnectorAddress) the connector will wait until a connection can be established or a terminal condition (e.g. inauthentic client) occurs. This connection behavior can be modified to timeout after a specified period (see connect(JMSConnectorAddress, long)).

The connector remote request behavior can also be customized; by default requests will timeout after 30 seconds and this timeout may encapsulate waiting for a (re)connect or a response to arrive. It is possible that requests will timeout due to heavily loaded systems and large amounts of data. In such cases the default request timeout may be modified using setRequestTimeout(long). Also since the default behavior is to span short term disconnects, the connector behavior can be modified to fail requests immediately if the connector is not actaully connected at the time the request is made; this done using setFailWhenDisconnected(boolean). This specific modified behavior does not apply to the add/remove of notification subscriptions.

The JMS Connector implements its own reconnect logic that includes reestablishing context. This allows the connector to handle short-term network failures and alleviates API programmers from implementing their own reconnect logic.

NOTE: JMX (as of v1.1) does not formalize the remote access to JMX MBean servers. Sun have provided sample connectors on which this JMS connector has been loosely modelled. When remote access has been formalized in the JMX specification, this JMS Connector will be made conformant to the specification.

See Also:
JMSConnectorAddress, CommunicationException, MBeanServer

Constructor Summary
JMSConnectorClient()
           
 
Method Summary
 void addNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback)
          Supported connector modes: bounded, unbounded
 void addNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback, long timeout)
          Supported connector modes: bounded, unbounded
 void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, java.lang.Object handback)
          Unsupported
 java.lang.String connect(JMSConnectorAddress address)
          Connects the connector to the underlying JMS transport.
 java.lang.String connect(JMSConnectorAddress address, long timeout)
          Connects the connector to the underlying JMS transport.
 ObjectInstance createMBean(java.lang.String className, ObjectName objectName)
          Supported connector modes: bounded
 ObjectInstance createMBean(java.lang.String className, ObjectName objectName, java.lang.Object[] params, java.lang.String[] signature)
          Supported connector modes: bounded
 ObjectInstance createMBean(java.lang.String className, ObjectName objectName, ObjectName loaderName)
          Supported connector modes: bounded
 ObjectInstance createMBean(java.lang.String className, ObjectName objectName, ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Supported connector modes: bounded
 void deregisterRetryCallback()
           
 void disconnect()
          Disconnect the connector from the underlying JMS transport.
 java.lang.Object getAttribute(ObjectName objectName, java.lang.String attribute)
          Supported connector modes: bounded, unbounded
 AttributeList getAttributes(ObjectName objectName, java.lang.String[] attributes)
          Supported connector modes: bounded, unbounded
 IConnectionListener getConnectionListener()
          Gets the (singleton) connection listener for the connector.
 long getConnectTimeout()
          Gets the connect timeout in milliseconds.
 java.lang.String getDefaultDomain()
          Supported connector modes: bounded
 java.lang.String[] getDomains()
          Returns the list of domains in which any MBean is currently registered.
 boolean getFailWhenDisconnected()
           
 java.lang.Integer getMBeanCount()
          Supported connector modes: bounded
 MBeanInfo getMBeanInfo(ObjectName objectName)
          Supported connector modes: bounded, unbounded
 long getNotificationSubscriptionRenewalInterval()
          Gets the interval, in seconds, that notification subscriptions will be renewed
 long getNotificationSubscriptionTimeout()
          Gets the duration, in seconds, a notification subscription will "live" before it must be renewed
 ObjectInstance getObjectInstance(ObjectName objectName)
          Supported connector modes: bounded, unbounded
 IOrphanedReplyListener getOrphanedReplyListener()
          Gets the (singleton) orphaned reply listener for the connector.
 long getRequestTimeout()
          Gets the default timeout the connector waits for responses from remote requests.
 long getSocketConnectTimeout()
          Gets the socket connect timeout in milliseconds.
 int getTraceMask()
          Gets System.out runtime debug tracing mask.
 boolean getUseOnewaySubscriptionRequests()
          By default JMX notification subscriptions (and renewals) are made using a request/reply mechanism that ensures successful is made or the user is notified via a registered callback.
 java.lang.Object invoke(ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Supported connector modes: bounded, unbounded
 java.lang.Object invoke(ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature, java.lang.ClassLoader loader)
          Supported connector modes: bounded, unbounded
 java.lang.Object invoke(ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature, long timeout)
          This method allows remote invocation of the given operations with a particular timeout.
 java.lang.Object invoke(ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature, long timeout, java.lang.ClassLoader loader)
          This method allows remote invocation of the given operations with a particular timeout.
 boolean isConnected()
           
 boolean isInstanceOf(ObjectName objectName, java.lang.String className)
          Supported connector modes: bounded, unbounded
 boolean isRegistered(ObjectName objectName)
          Supported connector modes: bounded, unbounded
 java.util.Set queryMBeans(ObjectName objectName, QueryExp query)
          Supported connector modes: bounded
 java.util.Set queryNames(ObjectName objectName, QueryExp query)
          Supported connector modes: bounded
 void registerRetryCallback(com.sonicsw.mf.comm.IRetryCallback rcb)
           
 void removeNotificationListener(ObjectName objectName, NotificationListener listener)
          Supported connector modes: bounded, unbounded
 void removeNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback)
          Supported connector modes: bounded, unbounded
 void removeNotificationListener(ObjectName objectName, ObjectName listener)
          Supported connector modes: bounded, unbounded
 void removeNotificationListener(ObjectName objectName, ObjectName listener, NotificationFilter filter, java.lang.Object handback)
          Supported connector modes: bounded, unbounded
 void setAttribute(ObjectName objectName, Attribute attribute)
          Supported connector modes: bounded, unbounded
 AttributeList setAttributes(ObjectName objectName, AttributeList attributes)
          Supported connector modes: bounded, unbounded
 void setConnectionListener(IConnectionListener listener)
          Sets the (singleton) connection listener for the connector.
 void setConnectTimeout(long milliseconds)
          Sets the connect timeout in milliseconds.
 void setFailWhenDisconnected(boolean failWhenDisconnected)
          When true, causes requests (invoke, setAttribute, etc.) to fail immediately if the connector is in a transient disconnected state.
 void setNotificationSubscriptionRenewalInterval(long interval)
          Sets the interval, in seconds, that notification subscriptions will be renewed
 void setNotificationSubscriptionTimeout(long seconds)
          Sets the duration, in seconds, that a notification subscription will "live" before it must be renewed
 void setOrphanedReplyListener(IOrphanedReplyListener listener)
          Sets the (singleton) orphaned reply listener for the connector.
 void setRequestTimeout(long milliseconds)
          Sets the default timeout the connector waits for responses from remote requests.
 void setSocketConnectTimeout(long milliseconds)
          Sets the socket connect timeout in milliseconds.
 void setTraceMask(int maskValue)
          Sets System.out runtime debug tracing mask.
 void setUseOnewaySubscriptionRequests(boolean useOneway)
          By default JMX notification subscriptions (and renewals) are made using a request/reply mechanism that ensures successful is made or the user is notified via a registered callback.
 void unregisterMBean(ObjectName objectName)
          Supported connector modes: bounded
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSConnectorClient

public JMSConnectorClient()
Method Detail

addNotificationListener

public void addNotificationListener(ObjectName objectName,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    java.lang.Object handback)
                             throws InstanceNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
addNotificationListener in interface IRemoteMBeanServer
Specified by:
addNotificationListener in interface MBeanServerConnection
Parameters:
objectName - 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.
See Also:
MBeanServer.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

addNotificationListener

public void addNotificationListener(ObjectName objectName,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    java.lang.Object handback,
                                    long timeout)
                             throws InstanceNotFoundException
Supported connector modes: bounded, unbounded

Throws:
InstanceNotFoundException
See Also:
MBeanServer.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    ObjectName listener,
                                    NotificationFilter filter,
                                    java.lang.Object handback)
                             throws InstanceNotFoundException
Unsupported

Specified by:
addNotificationListener in interface IRemoteMBeanServer
Specified by:
addNotificationListener in interface MBeanServerConnection
Parameters:
name - The name of the MBean on which the listener should be added.
listener - The object name of the listener 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 of the notification listener or of the notification broadcaster does not match any of the registered MBeans.
See Also:
MBeanServer.addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object)

connect

public java.lang.String connect(JMSConnectorAddress address)
Connects the connector to the underlying JMS transport.

NOTE: connect() will block until either the connection is established, a non-recoverable condition was determined (in which case a runtime exception will be thrown) or the thread invoking connect() is interrupted. Recoverable conditions include those consitions that might reasonably be expected, such as when the SonicMQ broker designated to carry management communications comes on line. Non-recoverable conditions include more permanent condition like the inability to resolve an IP address or a security failure such as an inauthentic client.

Specified by:
connect in interface IRemoteMBeanServer
Parameters:
address - The attributes describing how to connect to the underlying JMS transport.
Returns:
If the connector address dedicates the connector to a particular MBeanServer, the MBeanServer identity is returned, otherwise null is returned.
See Also:
disconnect()

connect

public java.lang.String connect(JMSConnectorAddress address,
                                long timeout)
Connects the connector to the underlying JMS transport.

NOTE: connect() will block until either the connection is established, a non-recoverable condition was determined (in which case a runtime exception will be thrown) or the thread invoking connect() is interrupted. Recoverable conditions include those consitions that might reasonably be expected, such as when the SonicMQ broker designated to carry management communications comes on line. Non-recoverable conditions include more permanent condition like the inability to resolve an IP address or a security failure such as an inauthentic client.

Parameters:
address - The attributes describing how to connect to the underlying JMS transport.
timeout - The number of milliseconds within which the initial connection must be established.
Returns:
If the connector address dedicates the connector to a particular MBeanServer, the MBeanServer identity is returned, otherwise null is returned.
See Also:
disconnect()

createMBean

public ObjectInstance createMBean(java.lang.String className,
                                  ObjectName objectName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Supported connector modes: bounded

Specified by:
createMBean in interface IRemoteMBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Parameters:
className - The class name of the MBean to be instantiated.
objectName - The object name of the MBean. May be null.
Returns:
An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. If the contained ObjectName is n, the contained Java class name is getMBeanInfo(n).getClassName().
Throws:
ReflectionException - Wraps a java.lang.ClassNotFoundException or a java.lang.Exception that occurred when 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 - The constructor of the MBean has thrown an exception
NotCompliantMBeanException - This class is not a JMX compliant MBean
See Also:
MBeanServer.createMBean(String, ObjectName)

createMBean

public ObjectInstance createMBean(java.lang.String className,
                                  ObjectName objectName,
                                  java.lang.Object[] params,
                                  java.lang.String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Supported connector modes: bounded

Specified by:
createMBean in interface IRemoteMBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Parameters:
className - The class name of the MBean to be instantiated.
objectName - The object name of the MBean. May be null.
params - An array containing the parameters of the constructor to be invoked.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. If the contained ObjectName is n, the contained Java class name is getMBeanInfo(n).getClassName().
Throws:
ReflectionException - Wraps a java.lang.ClassNotFoundException or a java.lang.Exception that occurred when 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 - The constructor of the MBean has thrown an exception
NotCompliantMBeanException - This class is not a JMX compliant MBean
See Also:
MBeanServer.createMBean(String, ObjectName, Object[], String[])

createMBean

public ObjectInstance createMBean(java.lang.String className,
                                  ObjectName objectName,
                                  ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Supported connector modes: bounded

Specified by:
createMBean in interface IRemoteMBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Parameters:
className - The class name of the MBean to be instantiated.
objectName - The object name of the MBean. May be null.
loaderName - The object name of the class loader to be used.
Returns:
An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. If the contained ObjectName is n, the contained Java class name is getMBeanInfo(n).getClassName().
Throws:
ReflectionException - Wraps a java.lang.ClassNotFoundException or a java.lang.Exception that occurred when 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 - The constructor of the MBean has thrown an exception
NotCompliantMBeanException - This class is not a JMX compliant MBean
InstanceNotFoundException - The specified class loader is not registered in the MBean server.
See Also:
MBeanServer.createMBean(String, ObjectName, ObjectName)

createMBean

public ObjectInstance createMBean(java.lang.String className,
                                  ObjectName objectName,
                                  ObjectName loaderName,
                                  java.lang.Object[] params,
                                  java.lang.String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Supported connector modes: bounded

Specified by:
createMBean in interface IRemoteMBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Parameters:
className - The class name of the MBean to be instantiated.
objectName - The object name of the MBean. May be null.
loaderName - The object name of the class loader to be used.
params - An array containing the parameters of the constructor to be invoked.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. If the contained ObjectName is n, the contained Java class name is getMBeanInfo(n).getClassName().
Throws:
ReflectionException - Wraps a java.lang.ClassNotFoundException or a java.lang.Exception that occurred when 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 - The constructor of the MBean has thrown an exception
NotCompliantMBeanException - This class is not a JMX compliant MBean
InstanceNotFoundException - The specified class loader is not registered in the MBean server.
See Also:
MBeanServer.createMBean(String, ObjectName, ObjectName, Object[], String[])

deregisterRetryCallback

public void deregisterRetryCallback()
See Also:
com.sonicsw.mf.comm.IConnectorClient#deregisterRetryCallback()

disconnect

public void disconnect()
Disconnect the connector from the underlying JMS transport.

Specified by:
disconnect in interface IRemoteMBeanServer
See Also:
connect(JMSConnectorAddress)

getAttribute

public java.lang.Object getAttribute(ObjectName objectName,
                                     java.lang.String attribute)
                              throws MBeanException,
                                     AttributeNotFoundException,
                                     InstanceNotFoundException,
                                     ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
getAttribute in interface IRemoteMBeanServer
Specified by:
getAttribute in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean from which the attribute is to be retrieved.
attribute - A String specifying the name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.
Throws:
MBeanException - Wraps an exception thrown by the MBean's getter.
AttributeNotFoundException - The attribute specified is not accessible in the MBean.
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
ReflectionException - Wraps a java.lang.Exception thrown when trying to invoke the setter.
See Also:
MBeanServer.getAttribute(ObjectName, String)

getAttributes

public AttributeList getAttributes(ObjectName objectName,
                                   java.lang.String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
getAttributes in interface IRemoteMBeanServer
Specified by:
getAttributes in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean from which the attributes are retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The list of the retrieved attributes.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
See Also:
MBeanServer.getAttributes(ObjectName, String[])

getConnectionListener

public IConnectionListener getConnectionListener()
Gets the (singleton) connection listener for the connector.

Returns:
Reference to a registered IConnectionListener implementation

getConnectTimeout

public long getConnectTimeout()
Gets the connect timeout in milliseconds.

See Also:
setConnectTimeout(long)

getDefaultDomain

public java.lang.String getDefaultDomain()
Supported connector modes: bounded

Specified by:
getDefaultDomain in interface IRemoteMBeanServer
Specified by:
getDefaultDomain in interface MBeanServerConnection
Returns:
the default domain.
See Also:
MBeanServer.getDefaultDomain()

getDomains

public java.lang.String[] getDomains()
                              throws java.io.IOException
Description copied from interface: MBeanServerConnection

Returns the list of domains in which any MBean is currently registered. A string is in the returned array if and only if there is at least one MBean registered with an ObjectName whose getDomain() is equal to that string. The order of strings within the returned array is not defined.

Specified by:
getDomains in interface MBeanServerConnection
Returns:
the list of domains.
Throws:
java.io.IOException - A communication problem occurred when talking to the MBean server.

getFailWhenDisconnected

public boolean getFailWhenDisconnected()
Returns:
Current setting of "failWhenDisconnected" flag
See Also:
setFailWhenDisconnected(boolean)

getMBeanCount

public java.lang.Integer getMBeanCount()
Supported connector modes: bounded

Specified by:
getMBeanCount in interface IRemoteMBeanServer
Specified by:
getMBeanCount in interface MBeanServerConnection
Returns:
the number of MBeans registered.
See Also:
MBeanServer.getMBeanCount()

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName objectName)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
getMBeanInfo in interface IRemoteMBeanServer
Specified by:
getMBeanInfo in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean to analyze
Returns:
An instance of MBeanInfo allowing the retrieval of all attributes and operations of this MBean.
Throws:
InstanceNotFoundException - The MBean specified was not found.
IntrospectionException - An exception occured during introspection.
ReflectionException - An exception occurred when trying to invoke the getMBeanInfo of a Dynamic MBean.
See Also:
MBeanServer.getMBeanInfo(ObjectName)

getNotificationSubscriptionRenewalInterval

public long getNotificationSubscriptionRenewalInterval()
Gets the interval, in seconds, that notification subscriptions will be renewed

Returns:
Current notification subscription renewal interval value in seconds

getNotificationSubscriptionTimeout

public long getNotificationSubscriptionTimeout()
Gets the duration, in seconds, a notification subscription will "live" before it must be renewed

Returns:
Current notification subscription timeout value in seconds

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName objectName)
                                 throws InstanceNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
getObjectInstance in interface IRemoteMBeanServer
Specified by:
getObjectInstance in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean.
Returns:
The ObjectInstance associated with the MBean specified by name. The contained ObjectName is name and the contained class name is getMBeanInfo(name).getClassName().
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
See Also:
MBeanServer.getObjectInstance(ObjectName)

getOrphanedReplyListener

public IOrphanedReplyListener getOrphanedReplyListener()
Gets the (singleton) orphaned reply listener for the connector.

Returns:
Reference to a registered IOrphanedReplyListener instance

getRequestTimeout

public long getRequestTimeout()
Gets the default timeout the connector waits for responses from remote requests.

Returns:
Current request timeout value in milliseconds

getSocketConnectTimeout

public long getSocketConnectTimeout()
Gets the socket connect timeout in milliseconds.

See Also:
setSocketConnectTimeout(long)

getTraceMask

public int getTraceMask()
Gets System.out runtime debug tracing mask. Values are as per JMS CONNECTOR values.


getUseOnewaySubscriptionRequests

public boolean getUseOnewaySubscriptionRequests()
By default JMX notification subscriptions (and renewals) are made using a request/reply mechanism that ensures successful is made or the user is notified via a registered callback.

By using a oneway subscription request, the client will never be notified that the subscription request failed. This is useful if there are a large volume of notification sources to which a subsciption has been made and such sources are often not running when the subscription is made or renewed.

Returns:
When true, oneway notification subscription requests will be made.
See Also:
IConnectionListener.onNotificationListenerRenewalFailure(Exception)

invoke

public java.lang.Object invoke(ObjectName objectName,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws InstanceNotFoundException,
                               MBeanException,
                               ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
invoke in interface IRemoteMBeanServer
Specified by:
invoke in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean on which the method is to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when the operation is invoked
signature - 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 operation, which represents the result ofinvoking the operation on the MBean specified.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
MBeanException - Wraps an exception thrown by the MBean's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.
See Also:
MBeanServer.invoke(ObjectName, String, Object[], String[])

invoke

public java.lang.Object invoke(ObjectName objectName,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature,
                               java.lang.ClassLoader loader)
                        throws InstanceNotFoundException,
                               MBeanException,
                               ReflectionException
Supported connector modes: bounded, unbounded

Throws:
InstanceNotFoundException
MBeanException
ReflectionException
See Also:
MBeanServer.invoke(ObjectName, String, Object[], String[])

invoke

public java.lang.Object invoke(ObjectName objectName,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature,
                               long timeout)
                        throws InstanceNotFoundException,
                               MBeanException,
                               ReflectionException
This method allows remote invocation of the given operations with a particular timeout. Supported connector modes: bounded, unbounded

Throws:
InstanceNotFoundException
MBeanException
ReflectionException
See Also:
setRequestTimeout(long), MBeanServer.invoke(ObjectName, String, Object[], String[])

invoke

public java.lang.Object invoke(ObjectName objectName,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature,
                               long timeout,
                               java.lang.ClassLoader loader)
                        throws InstanceNotFoundException,
                               MBeanException,
                               ReflectionException
This method allows remote invocation of the given operations with a particular timeout. Supported connector modes: bounded, unbounded

Throws:
InstanceNotFoundException
MBeanException
ReflectionException
See Also:
setRequestTimeout(long), MBeanServer.invoke(ObjectName, String, Object[], String[])

isConnected

public boolean isConnected()
Specified by:
isConnected in interface IRemoteMBeanServer
Returns:
Returns true if the connector has a live connection to the underlying transport. Gets the connection state of the connector.

isInstanceOf

public boolean isInstanceOf(ObjectName objectName,
                            java.lang.String className)
                     throws InstanceNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
isInstanceOf in interface IRemoteMBeanServer
Specified by:
isInstanceOf in interface MBeanServerConnection
Parameters:
objectName - The ObjectName of the MBean.
className - The name of the class.
Returns:
true if the MBean specified is an instance of the specified class according to the rules above, false otherwise.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
See Also:
MBeanServer.isInstanceOf(ObjectName, String)

isRegistered

public boolean isRegistered(ObjectName objectName)
Supported connector modes: bounded, unbounded

Specified by:
isRegistered in interface IRemoteMBeanServer
Specified by:
isRegistered in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean to be checked.
Returns:
True if the MBean is already registered in the MBean server, false otherwise.
See Also:
MBeanServer.isRegistered(ObjectName)

queryMBeans

public java.util.Set queryMBeans(ObjectName objectName,
                                 QueryExp query)
Supported connector modes: bounded

Specified by:
queryMBeans in interface IRemoteMBeanServer
Specified by:
queryMBeans in interface MBeanServerConnection
Parameters:
objectName - The object name pattern identifying the MBeans to be retrieved. If null or no domain and key properties are specified, all the MBeans registered will be retrieved.
query - The query expression to be applied for selecting MBeans. If null no query expression will be applied for selecting MBeans.
Returns:
A set containing the ObjectInstance objects for the selected MBeans. If no MBean satisfies the query an empty list is returned.
See Also:
MBeanServer.queryMBeans(ObjectName, QueryExp)

queryNames

public java.util.Set queryNames(ObjectName objectName,
                                QueryExp query)
Supported connector modes: bounded

Specified by:
queryNames in interface IRemoteMBeanServer
Specified by:
queryNames in interface MBeanServerConnection
Parameters:
objectName - The object name pattern identifying the MBean names to be retrieved. If null oror no domain and key properties are specified, the name of all registered MBeans will be retrieved.
query - The query expression to be applied for selecting MBeans. If null no query expression will be applied for selecting MBeans.
Returns:
A set containing the ObjectNames for the MBeans selected. If no MBean satisfies the query, an empty list is returned.
See Also:
MBeanServer.queryNames(ObjectName, QueryExp)

registerRetryCallback

public void registerRetryCallback(com.sonicsw.mf.comm.IRetryCallback rcb)
See Also:
com.sonicsw.mf.comm.IConnectorClient#registerRetryCallback(IRetryCallback)

removeNotificationListener

public void removeNotificationListener(ObjectName objectName,
                                       NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
removeNotificationListener in interface IRemoteMBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean on which the listener should be removed.
listener - The object name of the listener to be removed.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean.
See Also:
MBeanServer.removeNotificationListener(ObjectName, NotificationListener)

removeNotificationListener

public void removeNotificationListener(ObjectName objectName,
                                       NotificationListener listener,
                                       NotificationFilter filter,
                                       java.lang.Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
removeNotificationListener in interface IRemoteMBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean on which the listener should be removed.
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:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean, or it is not registered with the given filter and handback.
See Also:
MBeanServer.removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

removeNotificationListener

public void removeNotificationListener(ObjectName objectName,
                                       ObjectName listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
removeNotificationListener in interface IRemoteMBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean on which the listener should be removed.
listener - The object name of the listener to be removed.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean.
See Also:
MBeanServer.removeNotificationListener(ObjectName, ObjectName)

removeNotificationListener

public void removeNotificationListener(ObjectName objectName,
                                       ObjectName listener,
                                       NotificationFilter filter,
                                       java.lang.Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Supported connector modes: bounded, unbounded

Specified by:
removeNotificationListener in interface IRemoteMBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean on which the listener should be removed.
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:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean, or it is not registered with the given filter and handback.
See Also:
MBeanServer.removeNotificationListener(ObjectName, ObjectName, NotificationFilter, Object)

setAttribute

public void setAttribute(ObjectName objectName,
                         Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
setAttribute in interface IRemoteMBeanServer
Specified by:
setAttribute in interface MBeanServerConnection
Parameters:
objectName - The name of the MBean within which the attribute is to be set.
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
AttributeNotFoundException - The attribute specified is not accessible in the MBean.
InvalidAttributeValueException - The value specified for the attribute is not valid.
MBeanException - Wraps an exception thrown by the MBean's setter.
ReflectionException - Wraps a java.lang.Exception thrown when trying to invoke the setter.
See Also:
MBeanServer.setAttribute(ObjectName, Attribute)

setAttributes

public AttributeList setAttributes(ObjectName objectName,
                                   AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Supported connector modes: bounded, unbounded

Specified by:
setAttributes in interface IRemoteMBeanServer
Specified by:
setAttributes in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean within which the attributes are to be set.
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.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
See Also:
MBeanServer.setAttributes(ObjectName, AttributeList)

setConnectionListener

public void setConnectionListener(IConnectionListener listener)
Sets the (singleton) connection listener for the connector.

Parameters:
listener - Reference to an instance of an IConnectionListener implementation

setConnectTimeout

public void setConnectTimeout(long milliseconds)
Sets the connect timeout in milliseconds. This limits the total time allowed per JMS connection (or FT reconnect) attempt. The connection/reconnect attempt may involve several URLs if multiple connection URLs are provided. Subsequent connection attempts may be made if the timeout passed to connect() allows for this.

See Also:
setSocketConnectTimeout(long), connect(JMSConnectorAddress, long)

setFailWhenDisconnected

public void setFailWhenDisconnected(boolean failWhenDisconnected)
When true, causes requests (invoke, setAttribute, etc.) to fail immediately if the connector is in a transient disconnected state.

Parameters:
failWhenDisconnected - Flag to indicate if immediate failure should occur when in disconnected state

setNotificationSubscriptionRenewalInterval

public void setNotificationSubscriptionRenewalInterval(long interval)
Sets the interval, in seconds, that notification subscriptions will be renewed


setNotificationSubscriptionTimeout

public void setNotificationSubscriptionTimeout(long seconds)
Sets the duration, in seconds, that a notification subscription will "live" before it must be renewed


setOrphanedReplyListener

public void setOrphanedReplyListener(IOrphanedReplyListener listener)
Sets the (singleton) orphaned reply listener for the connector.

Parameters:
listener - Reference to an instance of an IOrphanedReplyListener implementation

setRequestTimeout

public void setRequestTimeout(long milliseconds)
Sets the default timeout the connector waits for responses from remote requests. The minimum is 10000 milliseconds (silently enforced).

Parameters:
milliseconds - Timeout value in milliseconds

setSocketConnectTimeout

public void setSocketConnectTimeout(long milliseconds)
Sets the socket connect timeout in milliseconds. This limits the connection time spent per-URL when multiple connection URLs are provided.

See Also:
setConnectTimeout(long)

setTraceMask

public void setTraceMask(int maskValue)
Sets System.out runtime debug tracing mask. Values are as per JMS CONNECTOR values.


setUseOnewaySubscriptionRequests

public void setUseOnewaySubscriptionRequests(boolean useOneway)
By default JMX notification subscriptions (and renewals) are made using a request/reply mechanism that ensures successful is made or the user is notified via a registered callback.

By using a oneway subscription request, the client will never be notified that the subscription request failed. This is useful if there are a large volume of notification sources to which a subsciption has been made and such sources are often not running when the subscription is made or renewed.

Parameters:
useOneway - When true, oneway notification subscription requests will be made.
See Also:
IConnectionListener.onNotificationListenerRenewalFailure(Exception)

unregisterMBean

public void unregisterMBean(ObjectName objectName)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException
Supported connector modes: bounded

Specified by:
unregisterMBean in interface IRemoteMBeanServer
Specified by:
unregisterMBean in interface MBeanServerConnection
Parameters:
objectName - The object name of the MBean to be unregistered.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.
MBeanRegistrationException - The preDeregister ((MBeanRegistration interface) method of the MBean has thrown an exception.
See Also:
MBeanServer.unregisterMBean(ObjectName objectName)

Sonic Management API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.