本文整理汇总了Java中org.apache.camel.util.ServiceHelper.stopAndShutdownServices方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceHelper.stopAndShutdownServices方法的具体用法?Java ServiceHelper.stopAndShutdownServices怎么用?Java ServiceHelper.stopAndShutdownServices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.camel.util.ServiceHelper
的用法示例。
在下文中一共展示了ServiceHelper.stopAndShutdownServices方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
// shutdown aggregation repository and the strategy
ServiceHelper.stopAndShutdownServices(aggregationRepository, aggregationStrategy);
// cleanup when shutting down
inProgressCompleteExchanges.clear();
if (shutdownExecutorService) {
camelContext.getExecutorServiceManager().shutdownNow(executorService);
}
if (shutdownTimeoutCheckerExecutorService) {
camelContext.getExecutorServiceManager().shutdownNow(timeoutCheckerExecutorService);
timeoutCheckerExecutorService = null;
}
super.doShutdown();
}
示例2: shutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
public void shutdown() throws Exception {
// ensure we are stopped first
stop();
if (shuttingdown.compareAndSet(false, true)) {
try {
try {
doShutdown();
} finally {
if (childServices != null) {
ServiceHelper.stopAndShutdownServices(childServices);
}
}
} finally {
// shutdown is also stopped so only set shutdown flags
shutdown.set(true);
shuttingdown.set(false);
}
}
}
示例3: shutdownServices
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
private void shutdownServices(Object service) {
// do not rethrow exception as we want to keep shutting down in case of problems
// allow us to do custom work before delegating to service helper
try {
if (service instanceof Service) {
ServiceHelper.stopAndShutdownService(service);
} else if (service instanceof Collection) {
ServiceHelper.stopAndShutdownServices((Collection<?>)service);
}
} catch (Throwable e) {
log.warn("Error occurred while shutting down service: " + service + ". This exception will be ignored.", e);
// fire event
EventHelper.notifyServiceStopFailure(this, service, e);
}
}
示例4: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
// when stopping we intend to shutdown
ServiceHelper.stopAndShutdownService(statistics);
if (stopServicePool) {
ServiceHelper.stopAndShutdownService(pool);
}
try {
ServiceHelper.stopAndShutdownServices(producers.values());
} finally {
// ensure producers are removed, and also from JMX
for (Producer producer : producers.values()) {
getCamelContext().removeService(producer);
}
}
producers.clear();
if (statistics != null) {
statistics.clear();
}
}
示例5: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
// when stopping we intend to shutdown
ServiceHelper.stopAndShutdownServices(statistics, pool);
try {
ServiceHelper.stopAndShutdownServices(consumers.values());
} finally {
// ensure consumers are removed, and also from JMX
for (PollingConsumer consumer : consumers.values()) {
getCamelContext().removeService(consumer);
}
}
consumers.clear();
if (statistics != null) {
statistics.clear();
}
}
示例6: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(producerCache, aggregationStrategy);
if (shutdownExecutorService && executorService != null) {
camelContext.getExecutorServiceManager().shutdownNow(executorService);
}
}
示例7: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(processors);
for (Processor processor : processors) {
removeProcessor(processor);
}
}
示例8: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(processors, errorHandlers, aggregationStrategy);
// only clear error handlers when shutting down
errorHandlers.clear();
if (shutdownExecutorService && executorService != null) {
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
}
if (aggregateExecutorService != null) {
getCamelContext().getExecutorServiceManager().shutdownNow(aggregateExecutorService);
}
}
示例9: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
if (scheduler != null) {
scheduler.unscheduleTask();
ServiceHelper.stopAndShutdownServices(scheduler);
}
// clear counters
backoffCounter = 0;
idleCounter = 0;
errorCounter = 0;
super.doStop();
}
示例10: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(processor);
}
示例11: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(output, errorHandler);
}
示例12: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(processor, idempotentRepository);
camelContext.removeService(idempotentRepository);
}
示例13: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(aggregationStrategy, consumerCache);
}
示例14: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(producerCache, errorHandlers);
// only clear error handlers when shutting down
errorHandlers.clear();
}
示例15: doShutdown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doShutdown() throws Exception {
ServiceHelper.stopAndShutdownServices(producerCache, producer);
}