/** * 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; }
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; } } }