private Exception decode(Exception e) { Throwable t = JMXExceptionDecoder.decode(e); if(t instanceof Exception) return (Exception) t; throw (Error) t; }
public CachedConnectionInterceptor() throws Exception { try { MBeanServer server = MBeanServerLocator.locateJBoss(); ccm = (CachedConnectionManager) server.getAttribute(CachedConnectionManagerMBean.OBJECT_NAME, "Instance"); } catch (Exception e) { JMXExceptionDecoder.rethrow(e); throw e; } }
Throwable result = JMXExceptionDecoder.decodeToJMXException(t); if (result instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException) result;
Throwable result = JMXExceptionDecoder.decodeToJMXException(t); if (result instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException) result;
/** * Decode and rethrow the given Throwable. If it * is a container JMX exception, then the target * is thrown. Otherwise the argument is thrown. */ public static void rethrow(final Exception e) throws Exception { Throwable t = decode(e); if (t instanceof Exception) throw (Exception) t; else throw (Error) t; } }
Throwable result = JMXExceptionDecoder.decodeToJMXException(t); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result;
/** * Go through the myriad of nested JMX exception to pull out the true * exception if possible and log it. * * @param e The exception to be logged. */ private void logException(Throwable e) { Throwable t = org.jboss.mx.util.JMXExceptionDecoder.decode(e); log.error("operation failed", t); }
JMXExceptionDecoder.rethrow(e);
Throwable result = JMXExceptionDecoder.decodeToJMXException(t); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result;
/** Unwrap a possibly nested jmx exception down to the last * JMException || JMRuntimeException. * * @param ex the exception to unwrap * @return A JMException || JMRuntimeException if ex was of this type, or * ex if it was not. */ public static Throwable decodeToJMXException(final Throwable ex) { Throwable jmxEx = ex; Throwable lastJmxEx = ex; while( jmxEx instanceof JMException || jmxEx instanceof JMRuntimeException) { lastJmxEx = jmxEx; jmxEx = decode(jmxEx); if( jmxEx == lastJmxEx ) break; } return lastJmxEx; }
JMXExceptionDecoder.rethrow(e);
/** * Deactivate */ protected void deactivate() { Object[] params = new Object[] { this, activationSpec }; try { server.invoke(resourceAdapterObjectName, "endpointDeactivation", params, activationSig); } catch (Throwable t) { t = JMXExceptionDecoder.decode(t); log.warn("Endpoint activation failed ra=" + resourceAdapterObjectName + " activationSpec=" + activationSpec, t); } } }
JMXExceptionDecoder.rethrow(e);
/** * The <code>shutdownServices</code> method calls the one and only * ServiceController to shut down all the mbeans registered with it. */ protected void shutdownServices() { try { // get the deployed objects from ServiceController controller.shutdown(); } catch (Exception e) { Throwable t = JMXExceptionDecoder.decode(e); log.error("Failed to shutdown services", t); } }
throw new RuntimeException("Could not get mbeanInfo", JMXExceptionDecoder.decode(e));
throw new RuntimeException("Could not get mbeanInfo", JMXExceptionDecoder.decode(e));
throw new RuntimeException("Could not get mbeanInfo", JMXExceptionDecoder.decode(e));