@Override public void stop() { this.getLifeCycleLock().writeLock().lock(); try { if (!this.isRunning()) { return; } stopProcessing(); stompProxyDead(); // Close the listeners for (AsyncEventListener listener : this.listeners) { listener.close(); } // stop the running threads, open sockets if any ((ConcurrentParallelGatewaySenderQueue) this.eventProcessor.getQueue()).cleanUp(); logger.info("Stopped {}", this); InternalDistributedSystem system = (InternalDistributedSystem) this.cache.getDistributedSystem(); system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_STOP, this); clearTempEventsAfterSenderStopped(); } finally { this.getLifeCycleLock().writeLock().unlock(); } }
@Override public void stop() { this.getLifeCycleLock().writeLock().lock(); try { if (!this.isRunning()) { return; } // Stop the dispatcher stopProcessing(); // Stop the proxy (after the dispatcher, so the socket is still // alive until after the dispatcher has stopped) stompProxyDead(); // Close the listeners for (AsyncEventListener listener : this.listeners) { listener.close(); } // stop the running threads, open sockets if any ((ConcurrentParallelGatewaySenderQueue) this.eventProcessor.getQueue()).cleanUp(); logger.info("Stopped {}", this); InternalDistributedSystem system = (InternalDistributedSystem) this.cache.getDistributedSystem(); system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_STOP, this); clearTempEventsAfterSenderStopped(); // Keep the eventProcessor around so we can ask it for the regionQueues later. // Tests expect to be able to do this. } finally { this.getLifeCycleLock().writeLock().unlock(); } }
listener.close();
listener.close();
@Override public void destroy() throws Exception { if (!this.cache.isClosed()) { try { this.asyncEventListener.close(); } catch (CacheClosedException ignore) { } } }
@Override public void destroy() throws Exception { if (!this.cache.isClosed()) { try { this.asyncEventListener.close(); } catch (CacheClosedException ignore) { } } }