论坛首页 Java企业应用论坛

mina2线程总结

浏览 19619 次
精华帖 (1) :: 良好帖 (10) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-07-15  
LZ帖子中涉及到源码,问个困扰很久的问题

core包下的SimpleProcessorPool.class下 有一段代码这样写的

  try {
                    processorConstructor = processorType
                            .getConstructor(ExecutorService.class);
                    pool[0] = processorConstructor.newInstance(executor);
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }

                try {
                    processorConstructor = processorType
                            .getConstructor(Executor.class);
                    pool[0] = processorConstructor.newInstance(executor);
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }

                try {
                    processorConstructor = processorType.getConstructor();
                    usesExecutorArg = false;
                    pool[0] = processorConstructor.newInstance();
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }

不知道作用是怎么样,能否解释一下?ExecotorService 是 Executor的实现,后面的写法不清楚了。
0 请登录后投票
   发表时间:2011-07-15  
mark一下,。,最近在学。
0 请登录后投票
   发表时间:2011-07-15  
我们的项目也用了这个...内部的东西还没全部搞透,只有个大概映像,看来你说的觉得应该差不多了
0 请登录后投票
   发表时间:2011-07-17  
总结得不错。
0 请登录后投票
   发表时间:2011-07-18  
没用过mina,现在正在用netty做游戏服务器
0 请登录后投票
   发表时间:2011-07-18  
LZ总结完了,就不回来看啦?很纠结。
0 请登录后投票
   发表时间:2011-07-18  
mina把一些异常信息给封装了,

比如你发一个mes id=5,
你无法在异常信息中得到是id=5的mes发生了错误

0 请登录后投票
   发表时间:2011-08-23  
讲的不错,正在学mina
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics