List of usage examples for javax.management MBeanException MBeanException
public MBeanException(java.lang.Exception e)
MBeanException
that wraps the actual java.lang.Exception
. From source file:catalina.mbeans.MBeanUtils.java
/** * Create, register, and return an MBean for this * <code>Valve</code> object. * * @param valve The Valve to be managed/*from w w w . ja v a 2 s. com*/ * * @exception Exception if an MBean cannot be created or registered */ public static ModelMBean createMBean(Valve valve) throws Exception { String mname = createManagedName(valve); ManagedBean managed = registry.findManagedBean(mname); if (managed == null) { Exception e = new Exception("ManagedBean is not found with " + mname); throw new MBeanException(e); } String domain = managed.getDomain(); if (domain == null) domain = mserver.getDefaultDomain(); ModelMBean mbean = managed.createMBean(valve); ObjectName oname = createObjectName(domain, valve); mserver.registerMBean(mbean, oname); return (mbean); }
From source file:net.lightbody.bmp.proxy.jetty.util.jmx.ModelMBeanImpl.java
public Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException { if (log.isDebugEnabled()) log.debug("invoke " + name); String methodKey = name + "("; if (signature != null) for (int i = 0; i < signature.length; i++) methodKey += (i > 0 ? "," : "") + signature[i]; methodKey += ")"; try {// w w w . j av a 2 s .c o m Method method = (Method) _method.get(methodKey); if (method == null) throw new NoSuchMethodException(methodKey); Object o = _object; if (method.getDeclaringClass().isInstance(this)) o = this; return method.invoke(o, params); } catch (NoSuchMethodException e) { log.warn(LogSupport.EXCEPTION, e); throw new ReflectionException(e); } catch (IllegalAccessException e) { log.warn(LogSupport.EXCEPTION, e); throw new MBeanException(e); } catch (InvocationTargetException e) { log.warn(LogSupport.EXCEPTION, e); throw new ReflectionException((Exception) e.getTargetException()); } }