Camel添加路由一般情况下是调用CamelContext的addRoutes(RoutesBuilder builder)方法实现的,下面我们看看该方法是如何实现路由的添加的:
public void addRoutes(RoutesBuilder builder) throws Exception {
//调用RouteBuilder的addRoutesToCamelContext方法,并...
分类:
其他好文 时间:
2014-09-06 20:03:13
阅读次数:
1327
Java代码:
public static void main(String[] args) throws Exception {
String numStr = "1fda2321fdf,1231 214 \n 345n234 23423saf23";
List list = parseNum2List(numStr);
Sys...
分类:
编程语言 时间:
2014-09-06 07:33:23
阅读次数:
387
这是一个很简单的Camel例子,代码如下:
public static void main(String[] args) throws Exception {
//创建Camel上下文
DefaultCamelContext camelContext = new DefaultCamelContext();
//添加一个路由,参数为路由建造者
camelContext.addRoutes...
分类:
其他好文 时间:
2014-09-06 01:07:52
阅读次数:
215
Thread类join()方法重载了3次.分别是join()throws InterruptedException; //无参数的join()等价于join(0),作用是一直等待该线程死亡join(long millis, int nanos) throws InterruptedExceptio....
分类:
编程语言 时间:
2014-09-05 17:46:11
阅读次数:
181
import java.lang.reflect.Field; public class InvokeFieldDemo { public static void main(String[] args) throws Exception { Class cl = null; Object obj =...
分类:
其他好文 时间:
2014-09-04 16:45:39
阅读次数:
177
1.jxl生成excel/** * @desc 写入 */ public void writeToExcel() throws Exception{ File file = new File(writePath);//创建文件 //创建工作薄 ...
分类:
其他好文 时间:
2014-09-03 18:07:06
阅读次数:
242
Quick Tip: How to Add Syntax Highlighting to Any Projectpublic String showAllArticleForPage() throws Exception{HttpServletRequest request = ServletActionContext.getRequest();String username=(String) A...
分类:
其他好文 时间:
2014-09-03 13:05:56
阅读次数:
201
public String showAllArticleForPage() throws Exception{
HttpServletRequest request = ServletActionContext.getRequest();
String username=(String) ActionContext.getContext().getSession().get("user");
...
分类:
其他好文 时间:
2014-09-03 13:05:26
阅读次数:
208
1、Java中的两种异常是什么?它们之间的差别?Java有两种类型的异常:checked与unchecked(检查与未检查) 异常. 假设unchecked异常可能会在方法或构造函数的运行时被抛出从而蔓延到方法或构造函数的外部, 它们也不须要要在方法或构造函数中声明throws子句. 然而, che...
分类:
其他好文 时间:
2014-09-02 14:07:44
阅读次数:
201
下载测试数据:http://grouplens.org/datasets/movielens/ ml-100k.zippublic class TMahout02 { public static void main(String[] args) throws IOException, Tast...
分类:
其他好文 时间:
2014-09-02 13:57:14
阅读次数:
194