|
Sonic Management API | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonicsw.mf.jmx.client.JMSConnectorClient
public class JMSConnectorClient
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.
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 |
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 |
java.lang.String |
getDefaultDomain()
Supported connector modes: bounded |
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 connect timeout |
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 |
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 connectTimeout)
Sets the connect timeout |
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 timeout)
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 timeout)
Sets the default timeout the connector waits for responses from remote requests. |
void |
setSocketConnectTimeout(long socketConnectTimeout)
Sets the socket connect timeout |
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 |
---|
public JMSConnectorClient()
Method Detail |
---|
public void addNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback) throws InstanceNotFoundException
addNotificationListener
in interface IRemoteMBeanServer
InstanceNotFoundException
MBeanServer.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
public void addNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback, long timeout) throws InstanceNotFoundException
InstanceNotFoundException
MBeanServer.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
public java.lang.String connect(JMSConnectorAddress address)
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.
connect
in interface IRemoteMBeanServer
address
- The attributes describing how to connect to the underlying JMS transport.
disconnect()
public java.lang.String connect(JMSConnectorAddress address, long timeout)
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.
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.
disconnect()
public ObjectInstance createMBean(java.lang.String className, ObjectName objectName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface IRemoteMBeanServer
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
MBeanServer.createMBean(String, ObjectName)
public ObjectInstance createMBean(java.lang.String className, ObjectName objectName, java.lang.Object[] params, java.lang.String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface IRemoteMBeanServer
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
MBeanServer.createMBean(String, ObjectName, Object[], String[])
public ObjectInstance createMBean(java.lang.String className, ObjectName objectName, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface IRemoteMBeanServer
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
MBeanServer.createMBean(String, ObjectName, ObjectName)
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
createMBean
in interface IRemoteMBeanServer
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
MBeanServer.createMBean(String, ObjectName, ObjectName, Object[], String[])
public void deregisterRetryCallback()
com.sonicsw.mf.comm.IConnectorClient#deregisterRetryCallback()
public void disconnect()
disconnect
in interface IRemoteMBeanServer
connect(JMSConnectorAddress)
public java.lang.Object getAttribute(ObjectName objectName, java.lang.String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute
in interface IRemoteMBeanServer
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
MBeanServer.getAttribute(ObjectName, String)
public AttributeList getAttributes(ObjectName objectName, java.lang.String[] attributes) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface IRemoteMBeanServer
InstanceNotFoundException
ReflectionException
MBeanServer.getAttributes(ObjectName, String[])
public IConnectionListener getConnectionListener()
public long getConnectTimeout()
public java.lang.String getDefaultDomain()
getDefaultDomain
in interface IRemoteMBeanServer
MBeanServer.getDefaultDomain()
public boolean getFailWhenDisconnected()
setFailWhenDisconnected(boolean)
public java.lang.Integer getMBeanCount()
getMBeanCount
in interface IRemoteMBeanServer
MBeanServer.getMBeanCount()
public MBeanInfo getMBeanInfo(ObjectName objectName) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface IRemoteMBeanServer
InstanceNotFoundException
IntrospectionException
ReflectionException
MBeanServer.getMBeanInfo(ObjectName)
public long getNotificationSubscriptionRenewalInterval()
public long getNotificationSubscriptionTimeout()
public ObjectInstance getObjectInstance(ObjectName objectName) throws InstanceNotFoundException
getObjectInstance
in interface IRemoteMBeanServer
InstanceNotFoundException
MBeanServer.getObjectInstance(ObjectName)
public IOrphanedReplyListener getOrphanedReplyListener()
public long getRequestTimeout()
public long getSocketConnectTimeout()
public int getTraceMask()
public boolean getUseOnewaySubscriptionRequests()
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.
IConnectionListener.onNotificationListenerRenewalFailure(Exception)
public java.lang.Object invoke(ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
invoke
in interface IRemoteMBeanServer
InstanceNotFoundException
MBeanException
ReflectionException
MBeanServer.invoke(ObjectName, String, Object[], String[])
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
InstanceNotFoundException
MBeanException
ReflectionException
MBeanServer.invoke(ObjectName, String, Object[], String[])
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
InstanceNotFoundException
MBeanException
ReflectionException
setRequestTimeout(long)
,
MBeanServer.invoke(ObjectName, String, Object[], String[])
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
InstanceNotFoundException
MBeanException
ReflectionException
setRequestTimeout(long)
,
MBeanServer.invoke(ObjectName, String, Object[], String[])
public boolean isConnected()
isConnected
in interface IRemoteMBeanServer
public boolean isInstanceOf(ObjectName objectName, java.lang.String className) throws InstanceNotFoundException
isInstanceOf
in interface IRemoteMBeanServer
InstanceNotFoundException
MBeanServer.isInstanceOf(ObjectName, String)
public boolean isRegistered(ObjectName objectName)
isRegistered
in interface IRemoteMBeanServer
MBeanServer.isRegistered(ObjectName)
public java.util.Set queryMBeans(ObjectName objectName, QueryExp query)
queryMBeans
in interface IRemoteMBeanServer
MBeanServer.queryMBeans(ObjectName, QueryExp)
public java.util.Set queryNames(ObjectName objectName, QueryExp query)
queryNames
in interface IRemoteMBeanServer
MBeanServer.queryNames(ObjectName, QueryExp)
public void registerRetryCallback(com.sonicsw.mf.comm.IRetryCallback rcb)
com.sonicsw.mf.comm.IConnectorClient#registerRetryCallback(IRetryCallback)
public void removeNotificationListener(ObjectName objectName, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface IRemoteMBeanServer
InstanceNotFoundException
ListenerNotFoundException
MBeanServer.removeNotificationListener(ObjectName, NotificationListener)
public void removeNotificationListener(ObjectName objectName, NotificationListener listener, NotificationFilter filter, java.lang.Object handback) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface IRemoteMBeanServer
InstanceNotFoundException
ListenerNotFoundException
MBeanServer.removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
public void setAttribute(ObjectName objectName, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface IRemoteMBeanServer
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
MBeanServer.setAttribute(ObjectName, Attribute)
public AttributeList setAttributes(ObjectName objectName, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface IRemoteMBeanServer
InstanceNotFoundException
ReflectionException
MBeanServer.setAttributes(ObjectName, AttributeList)
public void setConnectionListener(IConnectionListener listener)
listener
- Reference to an instance of an IConnectionListener implementationpublic void setConnectTimeout(long connectTimeout)
public void setFailWhenDisconnected(boolean failWhenDisconnected)
failWhenDisconnected
- Flag to indicate if immediate failure should occur when in disconnected statepublic void setNotificationSubscriptionRenewalInterval(long interval)
public void setNotificationSubscriptionTimeout(long timeout)
public void setOrphanedReplyListener(IOrphanedReplyListener listener)
listener
- Reference to an instance of an IOrphanedReplyListener implementationpublic void setRequestTimeout(long timeout)
timeout
- Timeout value in millisecondspublic void setSocketConnectTimeout(long socketConnectTimeout)
public void setTraceMask(int maskValue)
public void setUseOnewaySubscriptionRequests(boolean useOneway)
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.
useOneway
- When true, oneway notification subscription requests will be made.IConnectionListener.onNotificationListenerRenewalFailure(Exception)
public void unregisterMBean(ObjectName objectName) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface IRemoteMBeanServer
InstanceNotFoundException
MBeanRegistrationException
MBeanServer.unregisterMBean(ObjectName objectName)
|
Sonic Management API | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |