public interface RhinoConnection extends MBeanServerConnection
Rhino-specific connection interface.
Modifier and Type | Method and 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.
|
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
void connect() throws ConnectionException
Try to connect this connection.
ConnectionException
- if the connection attempt failedvoid disconnect()
Disconnect this connection.
void reconnect() throws ConnectionException
Disconnect then connect this connection.
ConnectionException
- if the connection attempt failedvoid testConnection() throws ConnectionException
Test this connection by invoking a basic MBean operation. If the test fails, an reconnect attempt will be triggered automatically.
ConnectionException
- if the test failed and the attempt to automatically reconnect failed.JMXConnector getJmxConnector()
Get the JMXConnector associated with this MBeanServer connection.
boolean getConnectedState()
Whether or not this connection is connected.
String getServerHost()
The host name of the current connection. Useful if this connection is configured to try multiple hosts.
int getServerPort()
The port of the current connection. Useful if this connection is configured to try multiple hosts.
int getServerNodeId()
The node ID of the server the current connection is to. Useful if this connection is configured to try multiple hosts.
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.
void setAllowedExecutionContext(ExecutionContext ctx)
Tell this connection to only allow particular connection contexts.
See ExecutionContext
for more details.
ctx
- the context to allowvoid 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.
namespace
- the namespace.
May be null
to indicate the default namespace.