• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DelegateAsyncProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.camel.processor.DelegateAsyncProcessor的典型用法代码示例。如果您正苦于以下问题:Java DelegateAsyncProcessor类的具体用法?Java DelegateAsyncProcessor怎么用?Java DelegateAsyncProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DelegateAsyncProcessor类属于org.apache.camel.processor包,在下文中一共展示了DelegateAsyncProcessor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
@Override
	public Processor wrapProcessorInInterceptors(CamelContext context,
			final ProcessorDefinition<?> definition, final Processor target,
			final Processor nextTarget) throws Exception {
		return new DelegateAsyncProcessor(new Processor() {
			@Override
			public void process(Exchange exchange) throws Exception {
//				if(!camelConfig.isRunning()){
//					System.err.println("系统将关闭,不在处理任务");
//					return ;
//				}
				System.out.println("defainition :"+definition);
				System.out.println("nextTarget :"+nextTarget);
				target.process(exchange);
			}
		});
	}
 
开发者ID:eXcellme,项目名称:eds,代码行数:18,代码来源:DemoInterceptor.java


示例2: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(final CamelContext context, final ProcessorDefinition<?> definition,
                                             final Processor target, final Processor nextTarget) throws Exception {
    return new DelegateAsyncProcessor(target) {
        @Override
        public boolean process(final Exchange exchange, final AsyncCallback callback) {
            debugger.beforeProcess(exchange, target, definition);
            final StopWatch watch = new StopWatch();

            return processor.process(exchange, new AsyncCallback() {
                public void done(boolean doneSync) {
                    long diff = watch.stop();
                    debugger.afterProcess(exchange, processor, definition, diff);

                    // must notify original callback
                    callback.done(doneSync);
                }
            });
        }

        @Override
        public String toString() {
            return "Debug[" + target + "]";
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:Debug.java


示例3: createErrorHandler

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor createErrorHandler(RouteContext routeContext, Processor processor) {
    return new DelegateAsyncProcessor(processor) {
        @Override
        public boolean process(final Exchange exchange, final AsyncCallback callback) {
            return super.process(exchange, new AsyncCallback() {
                @Override
                public void done(boolean doneSync) {
                    exchange.removeProperty(Exchange.REDELIVERY_EXHAUSTED);
                    callback.done(doneSync);
                }
            });
        }

        @Override
        public String toString() {
            if (processor == null) {
                // if no output then dont do any description
                return "";
            }
            return "NoErrorHandler[" + processor + "]";
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:NoErrorHandlerBuilder.java


示例4: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(final CamelContext context, final ProcessorDefinition<?> definition,
                                             final Processor target, final Processor nextTarget) throws Exception {

    return new DelegateAsyncProcessor(new Processor() {

        public void process(Exchange exchange) throws Exception {
            // we just count number of interceptions
            count++;
            LOG.info("I am the container wide interceptor. Intercepted total count: " + count);
            target.process(exchange);
        }

        @Override
        public String toString() {
            return "ContainerWideInterceptor[" + target + "]";
        }
    });
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:AdviceWithStartTargetIssueTest.java


示例5: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(final CamelContext context, final ProcessorDefinition<?> definition,
                                             final Processor target, final Processor nextTarget) throws Exception {

    // use DelegateAsyncProcessor to ensure the interceptor works well with the asynchronous routing
    // engine in Camel.
    // The target is the processor to continue routing to, which we must provide
    // in the constructor of the DelegateAsyncProcessor
    return new DelegateAsyncProcessor(target) {
        @Override
        public boolean process(Exchange exchange, AsyncCallback callback) {
            // we just want to count number of interceptions
            counter.incrementAndGet();

            // invoke processor to continue routing the message
            return processor.process(exchange, callback);
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:AsyncEndpointCustomAsyncInterceptorTest.java


示例6: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget) throws Exception {
    return new DelegateAsyncProcessor(target) {
        public boolean process(Exchange exchange, AsyncCallback callback) {
            invoked = true;
            return processor.process(exchange, callback);
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:AuditInterceptorAsyncDelegateIssueTest.java


示例7: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
@Override
public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget) throws Exception {
    if ("bean".equals(definition.getShortName())) {
        return new DelegateAsyncProcessor(exchange -> processorProxy.doAsSystem(target, exchange));
    } else {
        return target;
    }
}
 
开发者ID:projectomakase,项目名称:omakase,代码行数:9,代码来源:CamelBeanProcessorInterceptor.java


示例8: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(CamelContext context,
        ProcessorDefinition<?> definition, final Processor target,
        Processor nextTarget) throws Exception {

	return new DelegateAsyncProcessor(new Processor() {

		public void process(Exchange exchange) throws Exception {
			LOG.info("Before the processor...");
			target.process(exchange);
			LOG.info("After the processor...");
		}
	});
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:14,代码来源:MyInterceptor.java


示例9: initStatisticsInterceptor

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public void initStatisticsInterceptor() throws NullPointerException {
      theContext.addInterceptStrategy(new InterceptStrategy() {
	
	public Processor wrapProcessorInInterceptors(CamelContext context,
			final ProcessorDefinition<?> node, final Processor target,
			Processor nextTarget) throws Exception {
		return new DelegateAsyncProcessor(target) {
			public boolean process(Exchange exchange, AsyncCallback callback) {
				CamelStat.this.addRowByTargetNode(node.getId());
				return super.process(exchange, callback);
			}
		};
	}
});
  }
 
开发者ID:bio2rdf,项目名称:bio2rdf-rest,代码行数:16,代码来源:CamelStat.java


示例10: wrapProcessorInInterceptors

import org.apache.camel.processor.DelegateAsyncProcessor; //导入依赖的package包/类
public Processor wrapProcessorInInterceptors(CamelContext context,
        ProcessorDefinition<?> definition, final Processor target,
        Processor nextTarget) throws Exception {
	// to make the Default channel happy
	return new DelegateAsyncProcessor(new Processor() {

		public void process(Exchange exchange) throws Exception {
			log.info("Before the processor...");
			target.process(exchange);
			log.info("After the processor...");
		}
	});
}
 
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:14,代码来源:MyInterceptor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VectorAssembler类代码示例发布时间:2022-05-23
下一篇:
Java OWLModelManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap