当前位置: 首页>>代码示例>>Java>>正文


Java ServiceHelper.stopService方法代码示例

本文整理汇总了Java中org.apache.camel.util.ServiceHelper.stopService方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceHelper.stopService方法的具体用法?Java ServiceHelper.stopService怎么用?Java ServiceHelper.stopService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.camel.util.ServiceHelper的用法示例。


在下文中一共展示了ServiceHelper.stopService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    // stop event notifier
    camelContext.getManagementStrategy().removeEventNotifier(eventNotifier);
    ServiceHelper.stopService(eventNotifier);

    // stop and close collector
    ServiceHelper.stopAndShutdownService(spanCollector);
    if (spanCollector instanceof Closeable) {
        IOHelper.close((Closeable) spanCollector);
    }
    // clear braves
    braves.clear();
    // remove route policy
    camelContext.getRoutePolicyFactories().remove(this);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:ZipkinTracer.java

示例2: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@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;
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:ReplyManagerSupport.java

示例3: deactivate

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
public void deactivate() {
    try {
        ServiceHelper.stopService(consumer);
    } catch (Exception e) {
        LOG.warn("Error stopping consumer", e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:CamelDestination.java

示例4: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    // stop Salesforce processor
    ServiceHelper.stopService(processor);

    super.doStop();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:SalesforceProducer.java

示例5: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    super.doStop();

    ServiceHelper.stopServices(bootstrapFactories.values());
    bootstrapFactories.clear();

    ServiceHelper.stopService(multiplexChannelHandlers.values());
    multiplexChannelHandlers.clear();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:NettyHttpComponent.java

示例6: updateMulticastProcessor

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected synchronized void updateMulticastProcessor() throws Exception {
    // only needed if we support multiple consumers
    if (!isMultipleConsumersSupported()) {
        return;
    }

    // stop old before we create a new
    if (consumerMulticastProcessor != null) {
        ServiceHelper.stopService(consumerMulticastProcessor);
        consumerMulticastProcessor = null;
    }

    int size = getConsumers().size();
    if (size >= 1) {
        if (multicastExecutor == null) {
            // create multicast executor as we need it when we have more than 1 processor
            multicastExecutor = getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, URISupport.sanitizeUri(getEndpointUri()) + "(multicast)");
        }
        // create list of consumers to multicast to
        List<Processor> processors = new ArrayList<Processor>(size);
        for (SedaConsumer consumer : getConsumers()) {
            processors.add(consumer.getProcessor());
        }
        // create multicast processor
        multicastStarted = false;
        consumerMulticastProcessor = new MulticastProcessor(getCamelContext(), processors, null,
                                                            true, multicastExecutor, false, false, false, 
                                                            0, null, false, false);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:31,代码来源:SedaEndpoint.java

示例7: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
    if (processor != null) {
        ServiceHelper.stopService(processor);
    } else if (beanHolder instanceof ConstantBeanHolder) {
        try {
            // Stop the bean if it implements Service interface and if cached
            // so meant to be reused
            ServiceHelper.stopService(beanHolder.getBean());
        } catch (NoSuchBeanException e) {
            // ignore
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:BeanProcessor.java

示例8: unInitReplyManager

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void unInitReplyManager() {
    try {
        if (replyManager != null) {
            if (log.isDebugEnabled()) {
                log.debug("Stopping JmsReplyManager: {} from processing replies from: {}", replyManager,
                                getEndpoint().getReplyTo() != null ? getEndpoint().getReplyTo() : "temporary queue");
            }
            ServiceHelper.stopService(replyManager);
        }
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    } finally {
        started.set(false);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:RabbitMQProducer.java

示例9: afterPoll

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
public void afterPoll() throws Exception {
    LOG.trace("After poll {}", getEndpoint());
    // suspend or stop our self
    if (!ServiceHelper.suspendService(this)) {
        ServiceHelper.stopService(this);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:ScheduledPollConsumer.java

示例10: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
/**
 * Removes the notification listeners and terminates the background connection polling process if it exists
 */
@Override
protected void doStop() throws Exception {
    super.doStop();
    
    if (mScheduledExecutor != null) {
        getEndpoint().getCamelContext().getExecutorServiceManager().shutdownNow(mScheduledExecutor);
        mScheduledExecutor = null;
    }

    removeNotificationListeners();

    ServiceHelper.stopService(mFormatter);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:JMXConsumer.java

示例11: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    ServiceHelper.stopService(endpoint);
    super.doStop();
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:6,代码来源:ComponentProxyEndpoint.java

示例12: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    ServiceHelper.stopService(levelDBFile);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:LevelDBAggregationRepository.java

示例13: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
    ServiceHelper.stopService(consumer);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:EventDrivenPollingConsumer.java

示例14: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    ServiceHelper.stopService(pojo);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AggregationStrategyBeanAdapter.java

示例15: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    ServiceHelper.stopService(delegate);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:DeferProducer.java


注:本文中的org.apache.camel.util.ServiceHelper.stopService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。