public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException { try { return delegate.getObjectInstance(name); } catch(IOException e) { throw new RuntimeException(e); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); 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); } try { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
public Iterable<Result> fetchResults(MBeanServerConnection mbeanServer, ObjectName queryName) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException { ObjectInstance oi = mbeanServer.getObjectInstance(queryName); List<String> attributes; if (attr.isEmpty()) { attributes = new ArrayList<>(); MBeanInfo info = mbeanServer.getMBeanInfo(queryName); for (MBeanAttributeInfo attrInfo : info.getAttributes()) { attributes.add(attrInfo.getName()); } } else { attributes = attr; } try { if (!attributes.isEmpty()) { logger.debug("Executing queryName [{}] from query [{}]", queryName.getCanonicalName(), this); AttributeList al = mbeanServer.getAttributes(queryName, attributes.toArray(new String[attributes.size()])); return new JmxResultProcessor(this, oi, al.asList(), oi.getClassName(), queryName.getDomain()).getResults(); } } catch (UnmarshalException ue) { if ((ue.getCause() != null) && (ue.getCause() instanceof ClassNotFoundException)) { logger.debug("Bad unmarshall, continuing. This is probably ok and due to something like this: " + "http://ehcache.org/xref/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html#52", ue.getMessage()); } else { throw ue; } } return ImmutableList.of(); }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); 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); } try { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException,IOException{ return connection.getObjectInstance(name); }
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException { return server.getObjectInstance(name); } public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException {
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException { try { return delegate.getObjectInstance(name); } catch(IOException e) { throw new RuntimeException(e); } }
@Override public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException { try { return connection.getObjectInstance(name); } catch (IOException e) { checkConnection(); return connection.getObjectInstance(name); } }
@Override public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException { try { return connection.getObjectInstance(name); } catch (IOException e) { checkConnection(); return connection.getObjectInstance(name); } }
@Override public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException { try { return connection.getObjectInstance(name); } catch (IOException e) { checkConnection(); return connection.getObjectInstance(name); } }
@Override public Boolean call() throws Exception { mbsc.getObjectInstance(new ObjectName(JMXTestRunnerMBean.OBJECT_NAME)); LOGGER.fine("JMXTestRunnerMBean registered with the remote MBean server at: " + jmxServiceUrl); return true; } }).start();
@Override public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException { try { return connection.getObjectInstance(name); } catch (IOException e) { checkConnection(); return connection.getObjectInstance(name); } }
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException { try { return resolve(name).getObjectInstance(name); } catch (IOException e) { throw new RuntimeException(e); } }
public ObjectInstance getObjectInstance(ObjectName name, Subject delegate) throws InstanceNotFoundException, IOException { return getServer().getObjectInstance(name); }
@Override public Schema getSchema(ObjectName objectName) throws ServiceException { try { ObjectInstance oi = connection.getObjectInstance(objectName); if (null != oi) { return extractSchema(oi); } return null; } catch (Exception e) { LOGGER.throwing(this.getClass().getName(), "getSchema", e); throw new ServiceException(e); } }
@Test public void testGetObjectInstance() throws Exception { assertEquals(mbeanServerConnection.getObjectInstance(testMBeanName), platformMBeanServer.getObjectInstance(testMBeanName)); }
@Test public void testGetObjectInstance() throws Exception { assertEquals(mbeanServerConnection.getObjectInstance(testMBeanName), platformMBeanServer.getObjectInstance(testMBeanName)); }
@Test public void testGetObjectInstance() throws Exception { assertEquals(mbeanServerConnection.getObjectInstance(testMBeanName), platformMBeanServer.getObjectInstance(testMBeanName)); }
@Test public void testGetObjectInstance() throws Exception { assertEquals(mbeanServerConnection.getObjectInstance(testMBeanName), platformMBeanServer.getObjectInstance(testMBeanName)); }
public final ObjectInstance getObjectInstance(ObjectName objectName) 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().getObjectInstance(objectName); try { return getInstanceConnection(instance.get(0)).getObjectInstance(objectName); } catch (IOException ioex) { throw new InstanceNotFoundException(ioex.getLocalizedMessage()); } }