public static Object getMBeanAttribute(final ObjectName objectName, final String attribute) throws OperationFailedException { try { return ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, attribute); } catch (ReflectionException e) { Throwable t = e.getTargetException(); if (t instanceof SecurityException || t instanceof UnsupportedOperationException) { throw new OperationFailedException(e.toString()); } else if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t); } } catch (JMException e) { throw new RuntimeException(e); } }
public static Object getMBeanAttribute(final ObjectName objectName, final String attribute) throws OperationFailedException { try { return ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, attribute); } catch (ReflectionException e) { Throwable t = e.getTargetException(); if (t instanceof SecurityException || t instanceof UnsupportedOperationException) { throw new OperationFailedException(e.toString()); } else if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t); } } catch (JMException e) { throw new RuntimeException(e); } }
if (t instanceof ClassNotFoundException) throw e; throw new NotCompliantMBeanException("Error in constructor for " + code + " " + e.toString());
throw new MBeanProxyCreationException(e.toString());
if (t instanceof ClassNotFoundException) throw e; throw new NotCompliantMBeanException("Error in constructor for " + code + " " + e.toString());
throw new MBeanProxyCreationException(e.toString());
throw new MBeanProxyCreationException("Creating the MBean failed: " + e.toString());
throw new MBeanProxyCreationException("Creating the MBean failed: " + e.toString());