return resp;
}
public JoinHandle howToHandle(CacheRpcCommand cmd) {
Configuration localConfig = cmd.getConfiguration();
ComponentRegistry cr = cmd.getComponentRegistry();
if (localConfig.getCacheMode().isDistributed()) {
DistributionManager dm = cr.getComponent(DistributionManager.class);
if (dm.isJoinComplete())
return JoinHandle.OK;
else {
// no point in enqueueing clustered GET commands - just ignore these and hope someone else in the cluster responds.
if (!(cmd instanceof ClusteredGetCommand))
return JoinHandle.QUEUE;
else
return JoinHandle.IGNORE;
}
} else {
long giveupTime = System.currentTimeMillis() + localConfig.getStateRetrievalTimeout();
while (cr.getStatus().startingUp() && System.currentTimeMillis() < giveupTime)
LockSupport.parkNanos(MILLISECONDS.toNanos(100));
if (!cr.getStatus().allowInvocations()) {
log.cacheCanNotHandleInvocations(cmd.getCacheName(), cr.getStatus());
return JoinHandle.IGNORE;