protected Object chain(Object proxy, Method method, Object[] args) throws Exception { try { return method.invoke(proxy, args); } catch (InvocationTargetException x) { Throwable t = x.getTargetException(); if (t instanceof Exception) throw (Exception)t; throw new JMXServerErrorException("Error thrown during invocation", (Error)t); } } }
private Object chain(Object proxy, Method method, Object[] args) throws Exception { try { return super.invoke(proxy, method, args); } catch (Throwable x) { if (x instanceof Exception) throw (Exception)x; throw new JMXServerErrorException("Error thrown during invocation", (Error)x); } } }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { return super.invoke(proxy, method, args); } catch (NoSuchObjectException x) { // The connection has been already closed by the server throw new IOException("Connection closed by the server"); } catch (Exception x) { throw x; } catch (Error x) { throw new JMXServerErrorException("Error thrown during invocation", x); } } }
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(createExceptionResponse(new JMXServerErrorException("Internal error", e))).build();
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(createExceptionResponse(new JMXServerErrorException("Internal error", e))).build();
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(createExceptionResponse(new JMXServerErrorException("Internal error", e))).build();
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(createExceptionResponse(new JMXServerErrorException("Internal error", e))).build();
sendErrorResponse(response, SC_INTERNAL_SERVER_ERROR, new JMXServerErrorException("Internal error", e));
sendErrorResponse(response, SC_INTERNAL_SERVER_ERROR, new JMXServerErrorException("Internal error", e));
sendErrorResponse(response, SC_INTERNAL_SERVER_ERROR, new JMXServerErrorException("Internal error", e));
sendErrorResponse(response, SC_INTERNAL_SERVER_ERROR, new JMXServerErrorException("Internal error", e));
/** * @param req . * @return . * @throws IOException . */ private Message handleMBSReqMessage(final MBeanServerRequestMessage req) throws IOException { if (logger.traceOn()) logger.trace("RequestHandler.handleMBSReqMessage", "Receive a MBeanServerRequestMessage."); try { final AccessControlContext reqACC; final Subject delegationSubject = req.getDelegationSubject(); if (delegationSubject == null) reqACC = acc; else { if (subject == null) throw new SecurityException("Subject delegation cannot be enabled " + "unless an authenticated subject " + "is put in place"); reqACC = subjectDelegator.delegatedContext(acc, delegationSubject); } final Object result = AccessController.doPrivileged(new PrivilegedRequestJob(req), reqACC); return new MBeanServerResponseMessage(req.getMessageId(), result, false); } catch (Exception e) { e = extractException(e); if (logger.traceOn()) logger.trace("RequestHandler.handleMBSReqMessage", "Got an exception: " + e, e); return new MBeanServerResponseMessage(req.getMessageId(), wrapException(e), true); } catch (final Error r) { if (logger.traceOn()) logger.trace("RequestHandler.handleMBSReqMessage", "Got an error: " + r, r); final JMXServerErrorException see = new JMXServerErrorException(r.toString(), r); return new MBeanServerResponseMessage(req.getMessageId(), wrapException(see), true); } }