Object result = null;
boolean isException = false;
try {
result = mbsc.invoke(
(ObjectName)request.getParams()[0],
(String) request.getParams()[1],
(Object[]) request.getParams()[2],
(String[]) request.getParams()[3]);
}
catch(Throwable e) {
/*
generally it is better to have an exception caught, but since
the jmx connector is expected to preserve the Exception StackTrace,
I am catching Throwable. This is true with other callers too.
*/
result = e;
isException = true;
}
return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) );