public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException { try { return delegate.isInstanceOf(name, className); } catch(IOException e) { throw new RuntimeException(e); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("IsInstanceOf"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } paramType = unmarshaller.readByte(); if (paramType != STRING) { throw new IOException("Unexpected paramType"); } String className = unmarshaller.readUTF(); try { boolean instanceOf = server.getMBeanServerConnection().isInstanceOf(objectName, className); writeResponse(instanceOf, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Failure Response Sent", correlationId); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("IsInstanceOf"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } paramType = unmarshaller.readByte(); if (paramType != STRING) { throw new IOException("Unexpected paramType"); } String className = unmarshaller.readUTF(); try { boolean instanceOf = server.getMBeanServerConnection().isInstanceOf(objectName, className); writeResponse(instanceOf, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Failure Response Sent", correlationId); } }
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException { return server.isInstanceOf(name, className); } public boolean isRegistered(ObjectName name) throws IOException {
public boolean isInstanceOf(ObjectName name,String className) throws InstanceNotFoundException,IOException{ return connection.isInstanceOf(name, className); }
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException { try { return delegate.isInstanceOf(name, className); } catch(IOException e) { throw new RuntimeException(e); } }
@Override public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException { try { return connection.isInstanceOf(name, className); } catch (IOException e) { checkConnection(); return connection.isInstanceOf(name, className); } }
@Override public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException { try { return connection.isInstanceOf(name, className); } catch (IOException e) { checkConnection(); return connection.isInstanceOf(name, className); } }
@Override public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException { try { return connection.isInstanceOf(name, className); } catch (IOException e) { checkConnection(); return connection.isInstanceOf(name, className); } }
@Override public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException { try { return connection.isInstanceOf(name, className); } catch (IOException e) { checkConnection(); return connection.isInstanceOf(name, className); } }
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException { try { return resolve(name).isInstanceOf(name, className); } catch (IOException e) { throw new RuntimeException(e); } }
public boolean isInstanceOf(ObjectName name, String className, Subject delegate) throws InstanceNotFoundException, IOException { return getServer().isInstanceOf(name, className); }
public static MBeanMirror newMBeanMirror(MBeanServerConnection mbsc, ObjectName objectName, ObjectName localObjectName) throws IOException, InstanceNotFoundException, IntrospectionException { MBeanMirror mirror = new PlainMBeanMirror(mbsc, objectName, localObjectName); if (mbsc.isInstanceOf(objectName, NotificationBroadcaster.class.getName())) mirror = new NotifyingMBeanMirror( mirror); return mirror; } }
public static MBeanMirror newMBeanMirror(MBeanServerConnection mbsc, ObjectName objectName, ObjectName localObjectName) throws IOException, InstanceNotFoundException, IntrospectionException { MBeanMirror mirror = new PlainMBeanMirror(mbsc, objectName, localObjectName); if (mbsc.isInstanceOf(objectName, NotificationBroadcaster.class.getName())) mirror = new NotifyingMBeanMirror( mirror); return mirror; } }
public static MBeanMirror newMBeanMirror(MBeanServerConnection mbsc, ObjectName objectName, ObjectName localObjectName) throws IOException, InstanceNotFoundException, IntrospectionException { MBeanMirror mirror = new PlainMBeanMirror(mbsc, objectName, localObjectName); if (mbsc.isInstanceOf(objectName, NotificationBroadcaster.class.getName())) mirror = new NotifyingMBeanMirror( mirror); return mirror; } }
@Test public void testIsInstanceOf() throws Exception { assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, TestMBean.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, Object.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, UUID.class.getName()), false); }
@Test public void testIsInstanceOf() throws Exception { assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, TestMBean.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, Object.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, UUID.class.getName()), false); }
@Test public void testIsInstanceOf() throws Exception { assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, TestMBean.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, Object.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, UUID.class.getName()), false); }
@Test public void testIsInstanceOf() throws Exception { assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, TestMBean.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, Object.class.getName()), true); assertEquals(mbeanServerConnection.isInstanceOf(testMBeanName, UUID.class.getName()), false); }
public final boolean isInstanceOf ( final ObjectName objectName, final String str) throws InstanceNotFoundException { if(objectName == null) throw new InstanceNotFoundException(); List<String> instance = getInstance(objectName).getInstances(); if(instance.size() != 1) throw new InstanceNotFoundException(localStrings.getLocalString("interceptor.objectName.wrongservernames", "This mbean call does not support multiple target instances")); if((instance.get(0).equals("server"))) return getDelegateMBeanServer().isInstanceOf(objectName, str); try { return getInstanceConnection(instance.get(0)).isInstanceOf(objectName, str); } catch (IOException ioex) { throw new InstanceNotFoundException(ioex.getLocalizedMessage()); } }