public SerialGatewaySenderQueue(AbstractGatewaySender abstractSender, String regionName,
CacheListener listener) {
this.regionName = regionName;
this.headKey = -1;
this.tailKey.set(-1);
this.indexes = new HashMap<String, Map<Object, Long>>();
this.enableConflation = abstractSender.isBatchConflationEnabled();
this.diskStoreName = abstractSender.getDiskStoreName();
this.batchSize = abstractSender.getBatchSize();
this.enablePersistence = abstractSender.isPersistenceEnabled();
if (this.enablePersistence) {
this.isDiskSynchronous = abstractSender.isDiskSynchronous();
} else {
this.isDiskSynchronous = false;
}
this.maximumQueueMemory = abstractSender.getMaximumMemeoryPerDispatcherQueue();
this.stats = abstractSender.getStatistics();
initializeRegion(abstractSender, listener);
this.stats.incQueueSize(this.region.size());
this.removalThread = new BatchRemovalThread(abstractSender.getCache());
this.removalThread.start();
this.sender = abstractSender;
if (logger.isDebugEnabled()) {
logger.debug("{}: Contains {} elements", this, size());
}
}