Source:
public ICoreMessage handleMessage(Message message) throws Exception { message = message.toCore(); CoreMessage reply = new CoreMessage(storageManager.generateID(), 512); reply.setType(Message.TEXT_TYPE); reply.setReplyTo(message.getReplyTo()); String correlationId = getCorrelationIdentity(message); if (correlationId != null) { MessageUtil.setJMSCorrelationID(reply, correlationId); } String resourceName = message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME); if (logger.isDebugEnabled()) { logger.debug("handling management message for " + resourceName); } String operation = message.getStringProperty(ManagementHelper.HDR_OPERATION_NAME); if (operation != null) { Object[] params = ManagementHelper.retrieveOperationParameters(message); if (params == null) { params = new Object[0]; } try { Object result = invokeOperation(resourceName, operation, params); ManagementHelper.storeResult(reply, result); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.managementOperationError(e, operation, resourceName); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false); String exceptionMessage; if (e instanceof InvocationTargetException) { exceptionMessage = ((InvocationTargetException) e).getTargetException().getMessage(); } else { exceptionMessage = e.getMessage(); } ManagementHelper.storeResult(reply, exceptionMessage); } } else { String attribute = message.getStringProperty(ManagementHelper.HDR_ATTRIBUTE); if (attribute != null) { try { Object result = getAttribute(resourceName, attribute); ManagementHelper.storeResult(reply, result); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.managementAttributeError(e, attribute, resourceName); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false); String exceptionMessage; if (e instanceof InvocationTargetException) { exceptionMessage = ((InvocationTargetException) e).getTargetException().getMessage(); } else { exceptionMessage = e.getMessage(); } ManagementHelper.storeResult(reply, exceptionMessage); } } } return reply; }

Target:
public ICoreMessage handleMessage(Message message) throws Exception { message = message.toCore(); CoreMessage reply = new CoreMessage(storageManager.generateID(), 512); reply.setType(Message.TEXT_TYPE); reply.setReplyTo(message.getReplyTo()); Object correlationID = getCorrelationIdentity(message); if (correlationID != null) { reply.setCorrelationID(correlationID); } String resourceName = message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME); if (logger.isDebugEnabled()) { logger.debug("handling management message for " + resourceName); } String operation = message.getStringProperty(ManagementHelper.HDR_OPERATION_NAME); if (operation != null) { Object[] params = ManagementHelper.retrieveOperationParameters(message); if (params == null) { params = new Object[0]; } try { Object result = invokeOperation(resourceName, operation, params); ManagementHelper.storeResult(reply, result); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.managementOperationError(e, operation, resourceName); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false); String exceptionMessage; if (e instanceof InvocationTargetException) { exceptionMessage = ((InvocationTargetException) e).getTargetException().getMessage(); } else { exceptionMessage = e.getMessage(); } ManagementHelper.storeResult(reply, exceptionMessage); } } else { String attribute = message.getStringProperty(ManagementHelper.HDR_ATTRIBUTE); if (attribute != null) { try { Object result = getAttribute(resourceName, attribute); ManagementHelper.storeResult(reply, result); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.managementAttributeError(e, attribute, resourceName); reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false); String exceptionMessage; if (e instanceof InvocationTargetException) { exceptionMessage = ((InvocationTargetException) e).getTargetException().getMessage(); } else { exceptionMessage = e.getMessage(); } ManagementHelper.storeResult(reply, exceptionMessage); } } } return reply; }