public static <T extends PlatformManagedObject> T getPlatformMXBean (MBeanServerConnection connection, Class<T> mxbeanInterface) throws IOException

Returns the platform MXBean proxy for mxbeanInterface which is specified to have one single instance in a Java virtual machine and the proxy will forward the method calls through the given MBeanServerConnection. This method may return null if the management interface is not implemented in the Java virtual machine being monitored (for example, a Java virtual machine with no compilation system does not implement CompilationMXBean); otherwise, this method is equivalent to calling:

     getPlatformMXBeans(MBeanServerConnection, Class).get(0);
 

Parameters:
connection    the MBeanServerConnection to forward to.
mxbeanInterface    a management interface for a platform MXBean with one single instance in the Java virtual machine being monitored, if implemented.
<T>    an mxbeanInterface type parameter

Returns:  the platform MXBean proxy for forwarding the method calls of the mxbeanInterface through the given MBeanServerConnection, or null if not exist.

Exceptions:
IllegalArgumentException    if mxbeanInterface is not a platform management interface or not a singleton platform MXBean.
java.io.IOException    if a communication problem occurred when accessing the MBeanServerConnection.

See also:
newPlatformMXBeanProxy

Since:  1.7