本文整理汇总了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);
}
示例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;
}
}
示例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);
}
}
示例4: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
// stop Salesforce processor
ServiceHelper.stopService(processor);
super.doStop();
}
示例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();
}
示例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);
}
}
示例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
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例11: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopService(endpoint);
super.doStop();
}
示例12: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopService(levelDBFile);
}
示例13: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
protected void doStop() throws Exception {
ServiceHelper.stopService(consumer);
}
示例14: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopService(pojo);
}
示例15: doStop
import org.apache.camel.util.ServiceHelper; //导入方法依赖的package包/类
@Override
protected void doStop() throws Exception {
ServiceHelper.stopService(delegate);
}