Returns a client stub for this connector server. A client
stub is a serializable object whose connect
method can be used to make
one new connection to this connector server.
A given connector need not support the generation of client
stubs. However, the connectors specified by the JMX Remote API do
(JMXMP Connector and RMI Connector).
The default implementation of this method uses JMXConnectorServerMBean.getAddress()
and JMXConnectorFactory
to generate the
stub, with code equivalent to the following:
JMXServiceURL addr = getAddress()
;
return JMXConnectorFactory.newJMXConnector(addr, env)
;
A connector server for which this is inappropriate must
override this method so that it either implements the
appropriate logic or throws UnsupportedOperationException
.
Returns:
a client stub that can be used to make a new connection
to this connector server.
Parameters:
-
env - client connection parameters of the same sort that
could be provided to {@link JMXConnector#connect(Map)
JMXConnector.connect(Map)}. Can be null, which is equivalent
to an empty map.
Throws:
-
UnsupportedOperationException - if this connector
server does not support the generation of client stubs.
-
IllegalStateException - if the JMXConnectorServer is
not started (see {@link JMXConnectorServerMBean#isActive()}).
-
IOException - if a communications problem means that a
stub cannot be created.