return true;
}
@Override
public void run() {
Response resp;
try {
resp = handleInternal(cmd, cr);
} catch (RetryPrepareException retry) {
log.debugf(retry, "Prepare [%s] conflicted with state transfer", cmd);
resp = new ExceptionResponse(retry);
} catch (Throwable throwable) {
log.exceptionHandlingCommand(cmd, throwable);
resp = new ExceptionResponse(new CacheException("Problems invoking command.", throwable));
}
if (resp instanceof ExceptionResponse) {
totalOrderManager.release(state);
}
//the ResponseGenerated is null in this case because the return value is a Response
reply(response, resp);
}
});
return;
} else if (!preserveOrder && cmd.canBlock()) {
remoteCommandsExecutor.execute(new Runnable() {
@Override
public void run() {
Response resp;
try {
resp = handleInternal(cmd, cr);
} catch (Throwable throwable) {
log.exceptionHandlingCommand(cmd, throwable);
resp = new ExceptionResponse(new CacheException("Problems invoking command.", throwable));
}
reply(response, resp);
}
});
return;
}
Response resp = handleInternal(cmd, cr);
// A null response is valid and OK ...
if (trace && resp != null && !resp.isValid()) {
// invalid response
log.tracef("Unable to execute command, got invalid response %s", resp);
}
reply(response, resp);
}