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


Java ServiceHelper.stopServices方法代码示例

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


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

示例1: testMultithreaded

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
public void testMultithreaded() throws Exception {
    int numMessages = 100;

    Object[] bodies = new Object[numMessages];
    for (int i = 0; i < numMessages; i++) {
        bodies[i] = "msg" + i;
    }

    getMockEndpoint("mock:result").expectedBodiesReceived(bodies);
    getMockEndpoint("mock:result").setResultWaitTime(20000);

    ProducerTemplate producerTemplate = context.createProducerTemplate();
    ProducerTemplate producerTemplate2 = context.createProducerTemplate();

    ExecutorService service = context.getExecutorServiceManager().newFixedThreadPool(this, getName(), 2);

    service.execute(new Sender(producerTemplate, 0, numMessages, 2));
    service.execute(new Sender(producerTemplate2, 1, numMessages, 2));

    assertMockEndpointsSatisfied();

    ServiceHelper.stopServices(producerTemplate, producerTemplate2);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:StreamResequencerTest.java

示例2: 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

示例3: tearDown

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
@After
protected void tearDown() throws Exception {
    ServiceHelper.stopServices(context2, template2);

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

示例4: tearDown

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
@After
protected void tearDown() throws Exception {
    ServiceHelper.stopServices(context2, template2);
    VmComponent.ENDPOINTS.clear();
    VmComponent.QUEUES.clear();
    super.tearDown();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:AbstractVmTestSupport.java

示例5: doStop

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

示例6: doStop

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

示例7: stop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
public void stop() throws Exception {
    ServiceHelper.stopServices(staticMap.values());
    ServiceHelper.stopServices(values());
    purge();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:DefaultEndpointRegistry.java

示例8: doStop

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

示例9: doStop

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

示例10: doStop

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
    LOG.info("Stopping NettySharedHttpServer on {}:{}", configuration.getHost(), configuration.getPort());
    ServiceHelper.stopServices(bootstrapFactory, channelFactory);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:DefaultNettySharedHttpServer.java

示例11: doStop

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

示例12: doStop

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

示例13: doStop

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

        // if we are stopping CamelContext then we are shutting down
        boolean isShutdownCamelContext = camelContext.isStopping();

        if (isShutdownCamelContext || isRemovingRoutes()) {
            // need to call onRoutesRemove when the CamelContext is shutting down or Route is shutdown
            for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
                strategy.onRoutesRemove(routes);
            }
        }
        
        for (Route route : routes) {
            LOG.debug("Stopping services on route: {}", route.getId());

            // gather list of services to stop as we need to start child services as well
            Set<Service> services = gatherChildServices(route, true);

            // stop services
            stopChildService(route, services, isShutdownCamelContext);

            // stop the route itself
            if (isShutdownCamelContext) {
                ServiceHelper.stopAndShutdownServices(route);
            } else {
                ServiceHelper.stopServices(route);
            }

            // invoke callbacks on route policy
            if (route.getRouteContext().getRoutePolicyList() != null) {
                for (RoutePolicy routePolicy : route.getRouteContext().getRoutePolicyList()) {
                    routePolicy.onStop(route);
                }
            }
            // fire event
            EventHelper.notifyRouteStopped(camelContext, route);
        }
        if (isRemovingRoutes()) {
            camelContext.removeRouteCollection(routes);
        }
        // need to warm up again
        warmUpDone.set(false);
    }
 
开发者ID:HydAu,项目名称:Camel,代码行数:44,代码来源:RouteService.java

示例14: doStop

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

示例15: tearDown

import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
    ServiceHelper.stopServices(consumer, template, camelContext);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:JpaWithNamedQueryTest.java


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