Returns a proxy for a platform MXBean interface of a given MXBean name that forwards its method calls through the given MBeanServerConnection.
This method is equivalent to:
Proxy.newProxyInstance
(mxbeanInterface.getClassLoader(),
new Class[] { mxbeanInterface }, handler)
where handler is an InvocationHandler
to which method invocations to the MXBean interface
are dispatched. This handler converts an input parameter
from an MXBean data type to its mapped open type before forwarding
to the MBeanServer and converts a return value from
an MXBean method call through the MBeanServer
from an open type to the corresponding return type declared in
the MXBean interface.
If the MXBean is a notification emitter (i.e.,
it implements
NotificationEmitter
),
both the mxbeanInterface and NotificationEmitter
will be implemented by this proxy.
Notes:
IOException
may be thrown
when the communication problem occurs with the connector server.
An application remotely accesses the platform MXBeans using
proxy should prepare to catch IOException as if
accessing with the MBeanServerConnector interface.InvalidObjectException
which is thrown when an MXBean proxy receives a name of an
enum constant which is missing in the enum class loaded in
the client application. MBeanServerInvocationHandler
or its
newProxyInstance
method cannot be used to create
a proxy for a platform MXBean. The proxy object created
by MBeanServerInvocationHandler does not handle
the properties of the platform MXBeans described in
the class specification.
connection | the MBeanServerConnection to forward to. | |
mxbeanName | the name of a platform MXBean within
connection to forward to. mxbeanName must be
in the format of ObjectName . | |
mxbeanInterface | the MXBean interface to be implemented by the proxy. | |
<T> | an mxbeanInterface type parameter |
null
if not exist.
IllegalArgumentException | if
| |
java.io.IOException | if a communication problem occurred when accessing the MBeanServerConnection. |
Diagram: ManagementFactory