https://github.com/eclipse/jetty.project [ jetty 8]
The Jetty default connector is NIO SelectChannelConnector--> SelectorManager-->NIO Selector.
CXF Continuations API implementations [JettyContinuationWrapper-->for Jetty Server based on Jetty Continuation API, Servlet3Continuation for Servlet Container(tomcat...),JMSContinuation for JMS]
Continuation c=ContinuationSupport.getContinuation(HttpServletRequest);
c.addContinuationListener(new ContinuationListener(){
public void onComplete(Continuation c){}
public void onTimeout(Continuation c){}
});
c.setAttribute--->request.setAttribute
//c.setTimeout(2000);
c.suspend();//it will register to Jetty's NIO Selector to startAsync [ AsyncContext], non-blocking and throwing[ IllegalStateException ] on this action.
c.resume();//it will re-dispatch the original Request again, dispatch the request to the JettyServer's default QueuedThreadPool, non-blocking and throwing[ IllegalStateException ] on this action.
if timeout,after the onTimeout event fired, the context will re-dispatch the request again.
c.complete();//the context.complete(); just the onComplete event fired.
Jetty Continuation API implements Servlet3.0 AsyncContext
最新推荐文章于 2020-06-25 15:12:22 发布