* @throws IOException
*/
public Object dispatchRequest(JmxRequest pJmxReq)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
JsonRequestHandler handler = requestHandlerManager.getRequestHandler(pJmxReq.getType());
JMXConnector connector = getConnector(pJmxReq);
try {
MBeanServerConnection connection = connector.getMBeanServerConnection();
if (handler.handleAllServersAtOnce(pJmxReq)) {
// There is no way to get remotely all MBeanServers ...
MBeanServerExecutor manager = new MBeanServerExecutorRemote(connection);
return handler.handleRequest(manager,pJmxReq);
} else {
return handler.handleRequest(connection,pJmxReq);
}
} finally {
releaseConnector(connector);
}
}