public void stop() { stopped_ = true; serverTransport_.interrupt(); context.getExecutorServiceManager().shutdownGraceful(startExecutor); }
@Override public void stop() { super.stop(); context.getExecutorServiceManager().shutdownGraceful(startExecutor); }
@Override protected void doStop() throws Exception { ServiceHelper.stopService(correlation); if (listenerContainer != null) { log.debug("Closing connection: {} with timeout: {} ms.", listenerContainer, CLOSE_TIMEOUT); listenerContainer.close(CLOSE_TIMEOUT); listenerContainer = null; } // must also stop executor service if (executorService != null) { camelContext.getExecutorServiceManager().shutdownGraceful(executorService); executorService = null; } } }
@Override protected void doStop() throws Exception { if (executorService != null) { getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); executorService = null; } if (watcher != null) { IOHelper.close(watcher); } }
@Override protected void waitForShutdown() { joinSelector(); context.getExecutorServiceManager().shutdownGraceful(getInvoker()); } }
@Override protected void doStop() throws Exception { if (future != null) { future.cancel(true); future = null; } if (managedInstance) { instance.shutdown(); } getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); super.doStop(); } // *************************************************************************
private void stopService() { leader.set(false); try { if (future != null) { future.cancel(true); future = null; } manager.stop(); if (this.service != null) { this.service.stop(); } getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); } catch (Exception e) { throw new RuntimeCamelException(e); } }
@Override protected void doStop() throws Exception { ServiceHelper.stopService(correlation); if (listenerContainer != null) { log.debug("Stopping reply listener container on endpoint: {}", endpoint); try { listenerContainer.stop(); listenerContainer.destroy(); } finally { endpoint.onListenerContainerStopped(listenerContainer); listenerContainer = null; } } // must also stop executor service if (scheduledExecutorService != null) { camelContext.getExecutorServiceManager().shutdownGraceful(scheduledExecutorService); scheduledExecutorService = null; } if (executorService != null) { camelContext.getExecutorServiceManager().shutdownGraceful(executorService); executorService = null; } }
@Override protected void doStop() throws Exception { super.doStop(); if (sessionId != null) { sessionClient.destroySession(sessionId); sessionId = null; } if (executorService != null) { getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); } }
public void serve() { try { serverTransport_.listen(); } catch (TTransportException ttx) { LOGGER.error("Error occurred during listening.", ttx); return; } // Run the preServe event if (eventHandler_ != null) { eventHandler_.preServe(); } startExecutor.execute(() -> { stopped_ = false; setServing(true); waitForShutdown(); context.getExecutorServiceManager().shutdownGraceful(invoker); setServing(false); }); }
@Override protected void doStop() throws Exception { //Only shutdown the executorService if it is created by netty component if (configuration.isUsingExecutorService() && executorService != null) { getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); executorService = null; } //shutdown workerPool if configured if (configuration.getWorkerGroup() != null) { configuration.getWorkerGroup().shutdownGracefully(); } super.doStop(); }
@Override protected void doStop() throws Exception { log.info("Stopping Kafka consumer on topic: {}", endpoint.getConfiguration().getTopic()); if (executor != null) { if (getEndpoint() != null && getEndpoint().getCamelContext() != null) { getEndpoint().getCamelContext().getExecutorServiceManager().shutdownGraceful(executor); } else { executor.shutdownNow(); } if (!executor.isTerminated()) { tasks.forEach(KafkaFetchRecords::shutdown); executor.shutdownNow(); } } tasks.clear(); executor = null; if (stopOffsetRepo) { StateRepository repo = endpoint.getConfiguration().getOffsetRepository(); log.debug("Stopping OffsetRepository: {}", repo); ServiceHelper.stopAndShutdownService(repo); } super.doStop(); }