}
@Override
public void validate() {
if (reaperWakeUpInterval < 0)
throw new CacheConfigurationException("reaperWakeUpInterval must be > 0, we got " + reaperWakeUpInterval);
if (completedTxTimeout < 0)
throw new CacheConfigurationException("completedTxTimeout must be > 0, we got " + reaperWakeUpInterval);
if(transactionProtocol == TransactionProtocol.TOTAL_ORDER) {
//total order only supports transactional caches
if(transactionMode != TransactionMode.TRANSACTIONAL) {
throw new CacheConfigurationException("Total Order based protocol not available in " + transactionMode +" cache");
}
//total order only supports replicated and distributed mode
if(!clustering().cacheMode().isReplicated() && !clustering().cacheMode().isDistributed()) {
throw new CacheConfigurationException(clustering().cacheMode().friendlyCacheModeString() + " is not supported by Total Order based protocol");
}
if (recovery.create().enabled()) {
throw new CacheConfigurationException("Total Order based protocol not available with recovery");
}
if (lockingMode != LockingMode.OPTIMISTIC) {
throw new CacheConfigurationException("Total Order based protocol not available with " + lockingMode);
}
}
recovery.validate();
}