`
rain2005
  • 浏览: 14463 次
  • 来自: 武汉->大连->武汉
文章分类
社区版块
存档分类
最新评论
文章列表
To set up a Selector to monitor three Socket channels, you'd do something like this Selector selector = Selector.open(); channel1.register (selector, SelectionKey.OP_READ); channel2.register (selector, SelectionKey.OP_WRITE); channel3.register (selector, SelectionKey.OP_READ | SelectionKey.OP_W ...
上篇文章说的java的异步IO,熟悉unix IO调度方式的朋友应该清楚unix操作系统在非阻塞的调用形式结合selectors(选择器)select系统调用(感兴趣的朋友可以看看steven unix高级系统编程或者unix网络编程相当经典)提供了IO多路复用调用,这也是高并发服务器的IO调用方式(现在最新linux内核也提供了epoll形式的非阻塞调用这个留在以后讨论)。 以下就是nonblocking的socket SocketChannel sc = SocketChannel.open(); sc.configureBlocking (false);// nonbl ...
java NIO中核心接口Channel可以简单看成是文件描述符的包装,提供了操作文件描述方法,实现类调用底层操作系统低级IO方法read,write Channel接口有2中实现类 文件Channel,socket channel两种 下面看下几种获取Channel的方法 SocketChannel sc = SocketChannel.open(); sc.connect (new InetSocketAddress ("somehost", someport)); ServerSocketChannel ssc = ServerSocketChanne ...
1.JbpmContext作用   处理流程的持久化操作,可以获得一系列Jbpm已经提供的服务。 2.JbpmContext使用 JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); * try { * TaskInstance taskInstance = ... * * ...do your process operations... * * // in case you update a process object that was not fetched * ...
JbpmConfiguration 1.JbpmConfiguration作用    jBPM流程实例的配置,在流程的执行过程中,需要使用JbpmConfiguration去创建需要的服务。    JbpmConfiguration是线程安全的对象,可以使用单例模式创建。 2.JbpmConfiguration获取    代码1(from a resource)    String myXmlResource = "..."; JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance ...
Struts2 Action职责 1.处理实际的业务逻辑,这一点与Struts1.x Action作用相同 2.数据转换,自动处理从request里面提取的请求参数。实际上依赖interceptor实现 3.请求转发,跳转到试图 Struts 2 packages it’ll organize your actions and  other components into logical containers called packages Struts2 package 和java包相似,都是按照功能或者业务领域把类分组。同时Struts2 package提供了继承机制。 <pack ...
Global site tag (gtag.js) - Google Analytics