Package com.opencloud.slee.remote
Interface RhinoConnection
-
- All Superinterfaces:
AutoCloseable,Closeable,MBeanServerConnection
- All Known Implementing Classes:
ConnectionImpl
public interface RhinoConnection extends MBeanServerConnection, Closeable
Rhino-specific connection interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconnect()Try to connect this connection.voiddisconnect()Disconnect this connection.booleangetConnectedState()Whether or not this connection is connected.JMXConnectorgetJmxConnector()Get the JMXConnector associated with this MBeanServer connection.StringgetServerHost()The host name of the current connection.intgetServerNodeId()The node ID of the server the current connection is to.intgetServerPort()The port of the current connection.RhinoVersiongetServerRhinoVersion()The version of Rhino this connection is to.voidreconnect()Disconnect then connect this connection.voidsetAllowedExecutionContext(ExecutionContext ctx)Tell this connection to only allow particular connection contexts.voidsetNamespace(String namespace)Set the current Rhino namespace associated with this connection.voidtestConnection()Test this connection by invoking a basic MBean operation.-
Methods inherited from interface javax.management.MBeanServerConnection
addNotificationListener, addNotificationListener, createMBean, createMBean, createMBean, createMBean, getAttribute, getAttributes, getDefaultDomain, getDomains, getMBeanCount, getMBeanInfo, getObjectInstance, invoke, isInstanceOf, isRegistered, queryMBeans, queryNames, removeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, setAttribute, setAttributes, unregisterMBean
-
-
-
-
Method Detail
-
connect
void connect() throws ConnectionExceptionTry to connect this connection.- Throws:
ConnectionException- if the connection attempt failed
-
disconnect
void disconnect()
Disconnect this connection.
-
reconnect
void reconnect() throws ConnectionExceptionDisconnect then connect this connection.- Throws:
ConnectionException- if the connection attempt failed
-
testConnection
void testConnection() throws ConnectionExceptionTest this connection by invoking a basic MBean operation. If the test fails, an reconnect attempt will be triggered automatically.- Throws:
ConnectionException- if the test failed and the attempt to automatically reconnect failed.
-
getJmxConnector
JMXConnector getJmxConnector()
Get the JMXConnector associated with this MBeanServer connection.- Returns:
- a JMXConnector instance
-
getConnectedState
boolean getConnectedState()
Whether or not this connection is connected.- Returns:
- state of the connection
-
getServerHost
String getServerHost()
The host name of the current connection. Useful if this connection is configured to try multiple hosts.- Returns:
- host where this connection object is currently connected to Rhino
-
getServerPort
int getServerPort()
The port of the current connection. Useful if this connection is configured to try multiple hosts.- Returns:
- port where this connection object is currently connected to Rhino
-
getServerNodeId
int getServerNodeId()
The node ID of the server the current connection is to. Useful if this connection is configured to try multiple hosts.- Returns:
- node id of Rhino where this connection object is currently connected to
-
getServerRhinoVersion
RhinoVersion getServerRhinoVersion()
The version of Rhino this connection is to. Only available for Rhino versions 2.2 and above. This method returns null for versions of Rhino prior to 2.2.- Returns:
- Rhino version
-
setAllowedExecutionContext
void setAllowedExecutionContext(ExecutionContext ctx)
Tell this connection to only allow particular connection contexts. SeeExecutionContextfor more details.- Parameters:
ctx- the context to allow
-
setNamespace
void setNamespace(String namespace)
Set the current Rhino namespace associated with this connection. This namespace will be set as the active namespace if/when the connection needs to be re-established. Note that this method only affects local state, it does *not* invoke the NamespaceManagementMBean in Rhino to set the current active namespace.- Parameters:
namespace- the namespace. May benullto indicate the default namespace.
-
-