use of com.hazelcast.splitbrainprotection.SplitBrainProtectionListener in project hazelcast by hazelcast.
the class ListenerConfigHolder method asListenerConfig.
public <T extends ListenerConfig> T asListenerConfig(SerializationService serializationService) {
validate();
ListenerConfig listenerConfig = null;
if (className != null) {
switch(listenerType) {
case GENERIC:
listenerConfig = new ListenerConfig(className);
break;
case ITEM:
listenerConfig = new ItemListenerConfig(className, includeValue);
break;
case ENTRY:
listenerConfig = new EntryListenerConfig(className, local, includeValue);
break;
case SPLIT_BRAIN_PROTECTION:
listenerConfig = new SplitBrainProtectionListenerConfig(className);
break;
case CACHE_PARTITION_LOST:
listenerConfig = new CachePartitionLostListenerConfig(className);
break;
case MAP_PARTITION_LOST:
listenerConfig = new MapPartitionLostListenerConfig(className);
break;
default:
}
} else {
EventListener eventListener = serializationService.toObject(listenerImplementation);
switch(listenerType) {
case GENERIC:
listenerConfig = new ListenerConfig(eventListener);
break;
case ITEM:
listenerConfig = new ItemListenerConfig((ItemListener) eventListener, includeValue);
break;
case ENTRY:
listenerConfig = new EntryListenerConfig((MapListener) eventListener, local, includeValue);
break;
case SPLIT_BRAIN_PROTECTION:
listenerConfig = new SplitBrainProtectionListenerConfig((SplitBrainProtectionListener) eventListener);
break;
case CACHE_PARTITION_LOST:
listenerConfig = new CachePartitionLostListenerConfig((CachePartitionLostListener) eventListener);
break;
case MAP_PARTITION_LOST:
listenerConfig = new MapPartitionLostListenerConfig((MapPartitionLostListener) eventListener);
break;
default:
}
}
return (T) listenerConfig;
}
Aggregations