本文整理汇总了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);
}
示例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();
}
示例3: tearDown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
@After
protected void tearDown() throws Exception {
ServiceHelper.stopServices(context2, template2);
super.tearDown();
}
示例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();
}
示例5: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopServices(jsonMarshalProducer, jsonMarshalEndpoint);
super.doStop();
}
示例6: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopServices(processor);
}
示例7: stop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
public void stop() throws Exception {
ServiceHelper.stopServices(staticMap.values());
ServiceHelper.stopServices(values());
purge();
}
示例8: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
ServiceHelper.stopServices(tryProcessor, catchClauses, finallyProcessor);
}
示例9: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
ServiceHelper.stopServices(producerCache, aggregationStrategy);
}
示例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);
}
示例11: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
ServiceHelper.stopServices(processor);
}
示例12: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopServices(endpointCache.values());
endpointCache.clear();
}
示例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);
}
示例14: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopServices(jsonMarshal, jsonUnmarshal, xmlMarshal, xmlUnmarshal);
}
示例15: tearDown
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
ServiceHelper.stopServices(consumer, template, camelContext);
}