// --- replicate methods
case ReplicateCommand.MULTIPLE_METHOD_ID:
case ReplicateCommand.SINGLE_METHOD_ID:
{
ReplicateCommand returnValue = new ReplicateCommand();
returnValue.initialize(invoker);
command = returnValue;
break;
}
case InvalidateCommand.METHOD_ID:
{
if (configuration.isNodeLockingOptimistic())
{
OptimisticInvalidateCommand returnValue = new OptimisticInvalidateCommand();
returnValue.initialize(txManager);
returnValue.initialize(cacheSpi, dataContainer, notifier);
command = returnValue;
}
else
{
InvalidateCommand returnValue = new InvalidateCommand();
returnValue.initialize(cacheSpi, dataContainer, notifier);
command = returnValue;
}
break;
}
case ClusteredGetCommand.METHOD_ID:
{
ClusteredGetCommand returnValue = new ClusteredGetCommand();
returnValue.initialize(dataContainer, invoker);
command = returnValue;
break;
}
// ---- Buddy replication - group organisation commands
case AnnounceBuddyPoolNameCommand.METHOD_ID:
{
AnnounceBuddyPoolNameCommand returnValue = new AnnounceBuddyPoolNameCommand();
returnValue.initialize(buddyManager);
command = returnValue;
break;
}
case AssignToBuddyGroupCommand.METHOD_ID:
{
AssignToBuddyGroupCommand returnValue = new AssignToBuddyGroupCommand();
returnValue.initialize(buddyManager);
command = returnValue;
break;
}
case RemoveFromBuddyGroupCommand.METHOD_ID:
{
RemoveFromBuddyGroupCommand returnValue = new RemoveFromBuddyGroupCommand();
returnValue.initialize(buddyManager);
command = returnValue;
break;
}
case DataGravitationCleanupCommand.METHOD_ID:
{
DataGravitationCleanupCommand returnValue = new DataGravitationCleanupCommand();
returnValue.initialize(buddyManager, invoker, transactionTable, this, dataContainer, buddyFqnTransformer);
command = returnValue;
break;
}
case GravitateDataCommand.METHOD_ID:
{
GravitateDataCommand returnValue = new GravitateDataCommand(rpcManager.getLocalAddress());
returnValue.initialize(dataContainer, cacheSpi, buddyFqnTransformer);
command = returnValue;
break;
}
default:
throw new CacheException("Unknown command id " + id + "!");