声明:JavaEye新闻文章的版权属于JavaEye网站所有,严禁任何网站转载本文,否则必将追究法律责任!
Jean-Francois Arcand编写了一个DWR的补丁,可以让DWR的用户通过Reverse Engine来使用Grizzly Comet框架了。Grizzly真的是现在非常火爆的Java AJAX异步调用服务器端框架。
因为DWR也支持Jetty Continuations实现的异步调用,Jean-Francois Arcand比较了两种实现方法:
通过Jetty Continuations挂起连接:
通过Grizzly挂起连接:
Jean-Francois Arcand认为虽然Grizzly的实现方法略微复杂一些,但是Grizzly可以通过CometHandler在连接之间共享信息,要比Jetty Continuations功能强大,程序员有更多的控制能力。
也许我们应该多多关注Grizzly了。
因为DWR也支持Jetty Continuations实现的异步调用,Jean-Francois Arcand比较了两种实现方法:
通过Jetty Continuations挂起连接:
Continuation continuation = ContinuationSupport.getContinuation(request, mutex); continuation.suspend(timeout);
通过Grizzly挂起连接:
CometContext ctx = CometEngine.getEngine().register("DWR");
CometHandler continuationHandler = new CometHandler() {
public void attach(Object o) {
}
public void onEvent(CometEvent cometEvent) throws IOException {
}
public void onInitialize(CometEvent cometEvent) throws IOException {
}
public void onInterrupt(CometEvent cometEvent) throws IOException {
}
public void onTerminate(CometEvent cometEvent) throws IOException {
}
};
ctx.setExpirationDelay(sleepTime);
ctx.addCometHandler(continuationHandler);
Jean-Francois Arcand认为虽然Grizzly的实现方法略微复杂一些,但是Grizzly可以通过CometHandler在连接之间共享信息,要比Jetty Continuations功能强大,程序员有更多的控制能力。
也许我们应该多多关注Grizzly了。


评论 共 1 条 发表评论
hantsy 2007-11-27 10:09