protected GatewayEventDispatcher initializeEventDispatcher() { GatewayEventDispatcher dispatcher = null; if (getGateway().hasEndpoints()) { dispatcher = new GatewayEventRemoteDispatcher(this); } else { dispatcher = new GatewayEventCallbackDispatcher(this); } return dispatcher; }
/** * Acquires or adds a new <code>Connection</code> to the corresponding * <code>Gateway</code> * * @return the <code>Connection</code> * * @throws GatewayException */ Connection getConnection() throws GatewayException { if (this.connection == null) { // Initialize the connection initializeConnection(); // Reset the batch id to 0 to match the new connection this.eventProcessor.resetBatchId(); } return this.connection; }
Connection connection = getConnection(); int batchId = this.eventProcessor.getBatchId(); try { destroyConnection();
dispatchBatch(events); statistics.endBatch(start, events.size()); success = true;
protected GatewayEventRemoteDispatcher(GatewayEventProcessor eventProcessor) { this.eventProcessor = eventProcessor; this.logger = eventProcessor.getLogger(); try { initializeConnection(); } catch(GatewayException e) { if(e.getCause() instanceof GemFireSecurityException || e instanceof GatewayConfigurationException) { throw e; } } }