List of usage examples for javax.management MBeanServerConnection isInstanceOf
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException;
Returns true if the MBean specified is an instance of the specified class, false otherwise.
If name
does not name an MBean, this method throws InstanceNotFoundException .
Otherwise, let
X be the MBean named by name
,
L be the ClassLoader of X,
N be the class name in X's MBeanInfo .
If N equals className
, the result is true.
Otherwise, if L successfully loads className
and X is an instance of this class, the result is true.
From source file:org.helios.collector.jmx.connection.AbstractMBeanServerConnectionFactory.java
/** * Determines if the named MBean is an instance of the passed class name * @param objectName/*from www . j av a2s .c om*/ * @param className * @return * @throws InstanceNotFoundException * @throws IOException */ @Override @ManagedOperation public boolean isInstanceOf(ObjectName objectName, String className) throws InstanceNotFoundException, IOException { validateConn(); MBeanServerConnection conn = null; try { conn = getPooledConnection(); return conn.isInstanceOf(objectName, className); } catch (MBeanServerConnectionFactoryException e) { throw new RuntimeException("Failed to get pooled connection", e); } finally { try { this.returnPooledConnection(conn); } catch (Exception e) { log.debug(e.getMessage()); } } }