public class ConnectionImpl extends Object implements RhinoConnection, MBeanServerConnection
RhinoConnectionFactory to
obtain instances of this class.| Modifier | Constructor and Description |
|---|---|
protected |
ConnectionImpl(String[] hosts,
String username,
String password) |
protected |
ConnectionImpl(String[] hosts,
String username,
String password,
boolean attemptRhinoSsl) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback) |
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback) |
void |
connect()
Try to connect this connection.
|
ObjectInstance |
createMBean(String className,
ObjectName name) |
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature) |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName) |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature) |
protected void |
createMBeanServerConnection(String host,
int port,
String username,
String password) |
void |
disconnect()
Disconnect this connection.
|
Object |
getAttribute(ObjectName name,
String attribute) |
AttributeList |
getAttributes(ObjectName name,
String[] attributes) |
boolean |
getConnectedState()
Whether or not this connection is connected.
|
String |
getDefaultDomain() |
String[] |
getDomains() |
JMXConnector |
getJmxConnector()
Get the JMXConnector associated with this MBeanServer connection.
|
Integer |
getMBeanCount() |
MBeanInfo |
getMBeanInfo(ObjectName name) |
ObjectInstance |
getObjectInstance(ObjectName name) |
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.
|
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature) |
boolean |
isInstanceOf(ObjectName name,
String className) |
boolean |
isRegistered(ObjectName name) |
Set |
queryMBeans(ObjectName name,
QueryExp query) |
Set |
queryNames(ObjectName name,
QueryExp query) |
void |
reconnect()
Disconnect then connect this connection.
|
void |
removeNotificationListener(ObjectName name,
NotificationListener listener) |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback) |
void |
removeNotificationListener(ObjectName name,
ObjectName listener) |
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback) |
void |
setAllowedExecutionContext(ExecutionContext ctx)
Tell this connection to only allow particular connection contexts.
|
void |
setAttribute(ObjectName name,
Attribute attribute) |
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes) |
void |
setNamespace(String namespace)
Set the current Rhino namespace associated with this connection.
|
void |
testConnection()
Test this connection by invoking a basic MBean operation.
|
String |
toString() |
void |
unregisterMBean(ObjectName name) |
protected ConnectionImpl(String[] hosts, String username, String password) throws ConnectionException
ConnectionExceptionprotected ConnectionImpl(String[] hosts, String username, String password, boolean attemptRhinoSsl) throws ConnectionException
ConnectionExceptionpublic void setNamespace(String namespace)
RhinoConnectionsetNamespace in interface RhinoConnectionnamespace - the namespace. May be null to indicate the default namespace.public void connect()
throws ConnectionException
RhinoConnectionconnect in interface RhinoConnectionConnectionException - if the connection attempt failedpublic void disconnect()
RhinoConnectiondisconnect in interface RhinoConnectionpublic void testConnection()
throws ConnectionException
RhinoConnectiontestConnection in interface RhinoConnectionConnectionException - if the test failed and the attempt to automatically reconnect failed.public void reconnect()
throws ConnectionException
RhinoConnectionreconnect in interface RhinoConnectionConnectionException - if the connection attempt failedpublic JMXConnector getJmxConnector()
RhinoConnectiongetJmxConnector in interface RhinoConnectionpublic boolean getConnectedState()
RhinoConnectiongetConnectedState in interface RhinoConnectionpublic String getServerHost()
RhinoConnectiongetServerHost in interface RhinoConnectionpublic int getServerPort()
RhinoConnectiongetServerPort in interface RhinoConnectionpublic int getServerNodeId()
RhinoConnectiongetServerNodeId in interface RhinoConnectionpublic RhinoVersion getServerRhinoVersion()
RhinoConnectiongetServerRhinoVersion in interface RhinoConnectionpublic void setAllowedExecutionContext(ExecutionContext ctx)
RhinoConnectionExecutionContext
for more details.setAllowedExecutionContext in interface RhinoConnectionctx - the context to allowprotected void createMBeanServerConnection(String host, int port, String username, String password) throws ConnectionException, IOException
ConnectionExceptionIOExceptionpublic ObjectInstance createMBean(String className, ObjectName name) throws IOException, ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException
createMBean in interface MBeanServerConnectionIOExceptionReflectionExceptionInstanceAlreadyExistsExceptionMBeanExceptionNotCompliantMBeanExceptionpublic ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws IOException, ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean in interface MBeanServerConnectionIOExceptionReflectionExceptionInstanceAlreadyExistsExceptionMBeanExceptionNotCompliantMBeanExceptionInstanceNotFoundExceptionpublic ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws IOException, ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException
createMBean in interface MBeanServerConnectionIOExceptionReflectionExceptionInstanceAlreadyExistsExceptionMBeanExceptionNotCompliantMBeanExceptionpublic ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws IOException, ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean in interface MBeanServerConnectionIOExceptionReflectionExceptionInstanceAlreadyExistsExceptionMBeanExceptionNotCompliantMBeanExceptionInstanceNotFoundExceptionpublic void unregisterMBean(ObjectName name) throws IOException, InstanceNotFoundException, MBeanRegistrationException
unregisterMBean in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionMBeanRegistrationExceptionpublic ObjectInstance getObjectInstance(ObjectName name) throws IOException, InstanceNotFoundException
getObjectInstance in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionpublic Set queryMBeans(ObjectName name, QueryExp query) throws IOException
queryMBeans in interface MBeanServerConnectionIOExceptionpublic Set queryNames(ObjectName name, QueryExp query) throws IOException
queryNames in interface MBeanServerConnectionIOExceptionpublic boolean isRegistered(ObjectName name) throws IOException
isRegistered in interface MBeanServerConnectionIOExceptionpublic Integer getMBeanCount() throws IOException
getMBeanCount in interface MBeanServerConnectionIOExceptionpublic Object getAttribute(ObjectName name, String attribute) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute in interface MBeanServerConnectionIOExceptionMBeanExceptionAttributeNotFoundExceptionInstanceNotFoundExceptionReflectionExceptionpublic AttributeList getAttributes(ObjectName name, String[] attributes) throws IOException, InstanceNotFoundException, ReflectionException
getAttributes in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionReflectionExceptionpublic void setAttribute(ObjectName name, Attribute attribute) throws IOException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionAttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionExceptionpublic AttributeList setAttributes(ObjectName name, AttributeList attributes) throws IOException, InstanceNotFoundException, ReflectionException
setAttributes in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionReflectionExceptionpublic Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws IOException, InstanceNotFoundException, MBeanException, ReflectionException
invoke in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionMBeanExceptionReflectionExceptionpublic String getDefaultDomain() throws IOException
getDefaultDomain in interface MBeanServerConnectionIOExceptionpublic String[] getDomains() throws IOException
getDomains in interface MBeanServerConnectionIOExceptionpublic void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException
addNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionpublic void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException
addNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionpublic void removeNotificationListener(ObjectName name, NotificationListener listener) throws IOException, InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionListenerNotFoundExceptionpublic void removeNotificationListener(ObjectName name, ObjectName listener) throws IOException, InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionListenerNotFoundExceptionpublic void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionListenerNotFoundExceptionpublic void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionListenerNotFoundExceptionpublic MBeanInfo getMBeanInfo(ObjectName name) throws IOException, InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo in interface MBeanServerConnectionIOExceptionInstanceNotFoundExceptionIntrospectionExceptionReflectionExceptionpublic boolean isInstanceOf(ObjectName name, String className) throws IOException, InstanceNotFoundException
isInstanceOf in interface MBeanServerConnectionIOExceptionInstanceNotFoundException