Class RMIConnector

java.lang.Object
javax.management.remote.rmi.RMIConnector
All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, JMXAddressable, JMXConnector

public class RMIConnector extends Object implements JMXConnector, Serializable, JMXAddressable

A connection to a remote RMI connector. Usually, such connections are made using JMXConnectorFactory. However, specialized applications can use this class directly, for example with an RMIServer stub obtained without going through JNDI.

Since:
1.5
See Also:
  • Constructor Details

    • RMIConnector

      public RMIConnector(JMXServiceURL url, Map<String,?> environment)

      Constructs an RMIConnector that will connect the RMI connector server with the given address.

      The address can refer directly to the connector server, using the following syntax:

       service:jmx:rmi://[host[:port]]/stub/encoded-stub
       

      (Here, the square brackets [] are not part of the address but indicate that the host and port are optional.)

      The address can instead indicate where to find an RMI stub through JNDI, using the following syntax:

       service:jmx:rmi://[host[:port]]/jndi/jndi-name
       

      An implementation may also recognize additional address syntaxes, for example:

       service:jmx:myprotocolname://[host[:port]]/stub/encoded-stub
       
      Parameters:
      url - the address of the RMI connector server.
      environment - additional attributes specifying how to make the connection. For JNDI-based addresses, these attributes can usefully include JNDI attributes recognized by InitialContext. This parameter can be null, which is equivalent to an empty Map.
      Throws:
      IllegalArgumentException - if url is null.
    • RMIConnector

      public RMIConnector(RMIServer rmiServer, Map<String,?> environment)

      Constructs an RMIConnector using the given RMI stub.

      Parameters:
      rmiServer - an RMI stub representing the RMI connector server.
      environment - additional attributes specifying how to make the connection. This parameter can be null, which is equivalent to an empty Map.
      Throws:
      IllegalArgumentException - if rmiServer is null.
  • Method Details