private Response handleInternal(final CacheRpcCommand cmd, final ComponentRegistry cr) throws Throwable {
try {
if (trace) log.tracef("Calling perform() on %s", cmd);
ResponseGenerator respGen = cr.getResponseGenerator();
if(cmd instanceof CancellableCommand){
cancelService.register(Thread.currentThread(), ((CancellableCommand) cmd).getUUID());
}
Object retval = cmd.perform(null);
Response response = respGen.getResponse(cmd, retval);
log.tracef("About to send back response %s for command %s", response, cmd);
return response;
} catch (Exception e) {
log.error("Exception executing command", e);
return new ExceptionResponse(e);