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 void
connect()
Try to connect this connection.void
disconnect()
Disconnect this connection.boolean
getConnectedState()
Whether or not this connection is connected.JMXConnector
getJmxConnector()
Get the JMXConnector associated with this MBeanServer connection.String
getServerHost()
The host name of the current connection.int
getServerNodeId()
The node ID of the server the current connection is to.int
getServerPort()
The port of the current connection.RhinoVersion
getServerRhinoVersion()
The version of Rhino this connection is to.void
reconnect()
Disconnect then connect this connection.void
setAllowedExecutionContext(ExecutionContext ctx)
Tell this connection to only allow particular connection contexts.void
setNamespace(String namespace)
Set the current Rhino namespace associated with this connection.void
testConnection()
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 ConnectionException
Try to connect this connection.- Throws:
ConnectionException
- if the connection attempt failed
-
disconnect
void disconnect()
Disconnect this connection.
-
reconnect
void reconnect() throws ConnectionException
Disconnect then connect this connection.- Throws:
ConnectionException
- if the connection attempt failed
-
testConnection
void testConnection() throws ConnectionException
Test 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. SeeExecutionContext
for 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 benull
to indicate the default namespace.
-
-