public class DistributionResponseGenerator implements ResponseGenerator {
public Response getResponse(CacheRpcCommand command, Object returnValue) {
if (command instanceof ClusteredGetCommand) {
return returnValue == null ? null : new SuccessfulResponse(returnValue);
} else if (command instanceof SingleRpcCommand) {
SingleRpcCommand src = (SingleRpcCommand) command;
ReplicableCommand c = src.getCommand();
if (c instanceof WriteCommand) {
// check if this is successful.
if (((WriteCommand) c).isSuccessful())
return new SuccessfulResponse(returnValue);