use of org.apache.geode.internal.cache.xmlcache.GatewayReceiverCreation in project geode by apache.
the class GatewayReceiverFactoryImpl method create.
public GatewayReceiver create() {
if (this.startPort > this.endPort) {
throw new IllegalStateException("Please specify either start port a value which is less than end port.");
}
GatewayReceiver recv = null;
if (this.cache instanceof GemFireCacheImpl) {
recv = new GatewayReceiverImpl(this.cache, this.startPort, this.endPort, this.timeBetPings, this.socketBuffSize, this.bindAdd, this.filters, this.hostnameForSenders, this.manualStart);
this.cache.addGatewayReceiver(recv);
InternalDistributedSystem system = (InternalDistributedSystem) this.cache.getDistributedSystem();
system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_CREATE, recv);
if (!this.manualStart) {
try {
recv.start();
} catch (IOException ioe) {
throw new GatewayReceiverException(LocalizedStrings.GatewayReceiver_EXCEPTION_WHILE_STARTING_GATEWAY_RECEIVER.toLocalizedString(), ioe);
}
}
} else if (this.cache instanceof CacheCreation) {
recv = new GatewayReceiverCreation(this.cache, this.startPort, this.endPort, this.timeBetPings, this.socketBuffSize, this.bindAdd, this.filters, this.hostnameForSenders, this.manualStart);
this.cache.addGatewayReceiver(recv);
}
return recv;
}
Aggregations