Java Code Examples for javax.management.MBeanServerConnection#isInstanceOf()

The following examples show how to use javax.management.MBeanServerConnection#isInstanceOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ManagementFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isInstanceOf(MBeanServerConnection connection,
        ObjectName objName, String intfName)
        throws InstanceNotFoundException, IOException
{
    // special case for java.util.logging.LoggingMXBean.
    // java.util.logging.LoggingMXBean is deprecated and
    // replaced with java.lang.management.PlatformLoggingMXBean,
    // so we will consider that any MBean implementing
    // java.lang.management.PlatformLoggingMXBean also implements
    // java.util.logging.LoggingMXBean.
    if ("java.util.logging.LoggingMXBean".equals(intfName)) {
        if (connection.isInstanceOf(objName,
                PlatformLoggingMXBean.class.getName())) {
            return true;
        }
    }
    return connection.isInstanceOf(objName, intfName);
}