Interface RhinoConnection

    • Method Detail

      • disconnect

        void disconnect()
        Disconnect this connection.
      • 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. See ExecutionContext 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 be null to indicate the default namespace.