Returns an MBeanServerConnection
object representing
a remote MBean server on which operations are performed on behalf of
the supplied delegation subject. For a given JMXConnector
and Subject
, two successful calls to this method will
usually return the same MBeanServerConnection
object,
though this is not required.
For each method in the returned
MBeanServerConnection
, calling the method causes
the corresponding method to be called in the remote MBean
server on behalf of the given delegation subject instead of the
authenticated subject. The value returned by the MBean server
method is the value returned to the client. If the MBean server
method produces an Exception
, the same
Exception
is seen by the client. If the MBean
server method, or the attempt to call it, produces an
Error
, the Error
is wrapped in a
JMXServerErrorException
, which is seen by the
client.
Returns:
an object that implements the
MBeanServerConnection
interface by forwarding its methods to the remote MBean server on behalf
of a given delegation subject.
Parameters:
-
delegationSubject - the
Subject
on behalf of
which requests will be performed. Can be null, in which case
requests will be performed on behalf of the authenticated
Subject, if any.
Throws:
-
IOException - if a valid
MBeanServerConnection
cannot be created, for instance because the connection to the remote
MBean server has not yet been established (with the {@link #connect(Map)
connect} method), or it has been closed, or it has broken.