public class ReplicationQueueFactory extends EmptyConstructorNamedCacheFactory implements AutoInstantiableFactory {
@Override
@SuppressWarnings("unchecked")
public <T> T construct(Class<T> componentType) {
ClusteringConfiguration clustering = configuration.clustering();
if ((!clustering.cacheMode().isSynchronous()) && clustering.async().useReplQueue()) {
ReplicationQueue replQueue = clustering.async().replQueue();
return replQueue != null ? componentType.cast(replQueue) : (T) new ReplicationQueueImpl();
} else {
return null;
}