return (gatewaySender != null ? gatewaySender.getClass() : GatewaySender.class);
}
@Override
protected void doInit() {
GatewaySenderFactory gatewaySenderFactory = (this.factory != null ? (GatewaySenderFactory) factory
: cache.createGatewaySenderFactory());
if (alertThreshold != null) {
gatewaySenderFactory.setAlertThreshold(alertThreshold);
}
if (batchSize != null) {
gatewaySenderFactory.setBatchSize(batchSize);
}
if (batchTimeInterval != null) {
gatewaySenderFactory.setBatchTimeInterval(batchTimeInterval);
}
if (diskStoreReference != null) {
gatewaySenderFactory.setDiskStoreName(diskStoreReference);
}
if (diskSynchronous != null) {
gatewaySenderFactory.setDiskSynchronous(diskSynchronous);
}
if (dispatcherThreads != null) {
gatewaySenderFactory.setDispatcherThreads(dispatcherThreads);
}
if (batchConflationEnabled != null) {
gatewaySenderFactory.setBatchConflationEnabled(batchConflationEnabled);
}
if (!CollectionUtils.isEmpty(eventFilters)) {
for (GatewayEventFilter eventFilter : eventFilters) {
gatewaySenderFactory.addGatewayEventFilter(eventFilter);
}
}
if (eventSubstitutionFilter != null) {
gatewaySenderFactory.setGatewayEventSubstitutionFilter(eventSubstitutionFilter);
}
gatewaySenderFactory.setManualStart(true);
if (maximumQueueMemory != null) {
gatewaySenderFactory.setMaximumQueueMemory(maximumQueueMemory);
}
if (orderPolicy != null) {
Assert.isTrue(isSerialGatewaySender(), "Order Policy cannot be used with a Parallel Gateway Sender Queue.");
Assert.isTrue(VALID_ORDER_POLICIES.contains(orderPolicy.toUpperCase()),
String.format("The value for Order Policy '%1$s' is invalid.", orderPolicy));
gatewaySenderFactory.setOrderPolicy(Gateway.OrderPolicy.valueOf(orderPolicy.toUpperCase()));
}
gatewaySenderFactory.setParallel(isParallelGatewaySender());
gatewaySenderFactory.setPersistenceEnabled(isPersistent());
if (socketBufferSize != null) {
gatewaySenderFactory.setSocketBufferSize(socketBufferSize);
}
if (socketReadTimeout != null) {
gatewaySenderFactory.setSocketReadTimeout(socketReadTimeout);
}
if (!CollectionUtils.isEmpty(transportFilters)) {
for (GatewayTransportFilter transportFilter : transportFilters) {
gatewaySenderFactory.addGatewayTransportFilter(transportFilter);
}
}
GatewaySenderWrapper wrapper = new GatewaySenderWrapper(gatewaySenderFactory.create(getName(),
remoteDistributedSystemId));
wrapper.setManualStart(manualStart);
gatewaySender = wrapper;
}