public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { try { Method method = implementation.getClass().getMethod("get" + attribute, null); return method.invoke(implementation, new Object[0]); } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result; if (result instanceof MBeanException) throw (MBeanException)result; if (result instanceof ReflectionException) throw (ReflectionException)result; throw new MBeanException(e, "Cannot get attribute: " + attribute); } }
public AttributeList getAttributes(String[] attributes) { try { AttributeList attrList = new AttributeList(attributes.length); for (int i = 0; i < attributes.length; i++) { String name = attributes[i]; Object value = getAttribute(name); attrList.add(new Attribute(name, value)); } return attrList; } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); // Why is this not throwing the same exceptions as getAttribute(String) throw new RuntimeException("Cannot get attributes", result); } }
public AttributeList getAttributes(String[] attributes) { try { AttributeList attrList = new AttributeList(attributes.length); for (int i = 0; i < attributes.length; i++) { String name = attributes[i]; Object value = getAttribute(name); attrList.add(new Attribute(name, value)); } return attrList; } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); // Why is this not throwing the same exceptions as getAttribute(String) throw new RuntimeException("Cannot get attributes", result); } }
public AttributeList getAttributes(String[] attributes) { try { AttributeList attrList = new AttributeList(attributes.length); for (int i = 0; i < attributes.length; i++) { String name = attributes[i]; Object value = getAttribute(name); attrList.add(new Attribute(name, value)); } return attrList; } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); // Why is this not throwing the same exceptions as getAttribute(String) throw new RuntimeException("Cannot get attributes", result); } }
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { try { Class[] clArr = null; if (attribute.getValue() != null) { clArr = new Class[]{attribute.getValue().getClass()}; } Method method = implementation.getClass().getMethod("set" + attribute.getName(), clArr); method.invoke(implementation, new Object[]{attribute.getValue()}); } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result; if (result instanceof InvalidAttributeValueException) throw (InvalidAttributeValueException)result; if (result instanceof MBeanException) throw (MBeanException)result; if (result instanceof ReflectionException) throw (ReflectionException)result; throw new MBeanException(e, "Cannot set attribute: " + attribute); } }
public AttributeList setAttributes(AttributeList attributes) { AttributeList result = new AttributeList(attributes.size()); for (int i = 0; i < attributes.size(); ++i) { Attribute attr = (Attribute) attributes.get(i); String name = attr.getName(); try { setAttribute(attr); result.add(new Attribute(name, attr.getValue())); } catch (Throwable t) { JMException e = ExceptionHandler.handleException(t); result.add(new Attribute(name, e)); } } return result; }
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException { try { Class[] sigcl = new Class[signature.length]; for (int i = 0; i < signature.length; i++) { sigcl[i] = loadClass(signature[i]); } Method method = implementation.getClass().getMethod(actionName, sigcl); return method.invoke(implementation, params); } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); if (result instanceof MBeanException) throw (MBeanException)result; if (result instanceof ReflectionException) throw (ReflectionException)result; throw new MBeanException(e, "Cannot invoke: " + actionName); } }
public AttributeList setAttributes(AttributeList attributes) { AttributeList result = new AttributeList(attributes.size()); for (int i = 0; i < attributes.size(); ++i) { Attribute attr = (Attribute) attributes.get(i); String name = attr.getName(); try { setAttribute(attr); result.add(new Attribute(name, attr.getValue())); } catch (Throwable t) { JMException e = ExceptionHandler.handleException(t); result.add(new Attribute(name, e)); } } return result; }
JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result;
public AttributeList setAttributes(AttributeList attributes) { try { AttributeList attrList = new AttributeList(attributes.size()); Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute attr = (Attribute) it.next(); setAttribute(attr); String name = attr.getName(); Object value = getAttribute(name); attrList.add(new Attribute(name, value)); } return attrList; } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); // Why is this not throwing the same exceptions as setAttribute(Attribute) throw new RuntimeException("Cannot set attributes", result); } }
JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result;
JMException result = ExceptionHandler.handleException(e); if (result instanceof MBeanException) throw (MBeanException)result;
JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result;
JMException result = ExceptionHandler.handleException(e); if (result instanceof AttributeNotFoundException) throw (AttributeNotFoundException)result;
JMException result = ExceptionHandler.handleException(e); if (result instanceof MBeanException) throw (MBeanException)result;
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException { MBeanEntry entry = registry.get(name); checkMBeanPermission(entry.getResourceClassName(), null, name, "getMBeanInfo"); try { MBeanInvoker invoker = entry.getInvoker(); return invoker.getMBeanInfo(); } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result; if (result instanceof IntrospectionException) throw (IntrospectionException) result; if (result instanceof ReflectionException) throw (ReflectionException) result; throw new RuntimeException("Cannot obtain MBeanInfo " + name, result); } }
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException { MBeanEntry entry = registry.get(name); checkMBeanPermission(entry.getResourceClassName(), null, name, "getMBeanInfo"); try { MBeanInvoker invoker = entry.getInvoker(); return invoker.getMBeanInfo(); } catch (Exception e) { JMException result = ExceptionHandler.handleException(e); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result; if (result instanceof IntrospectionException) throw (IntrospectionException) result; if (result instanceof ReflectionException) throw (ReflectionException) result; throw new RuntimeException("Cannot obtain MBeanInfo " + name, result); } }