Jetty 9.1 发布,支持异步Async I/O

jopen 10年前

Jetty 是一个开源的servlet容器,它为基于Java的web内容,例如JSP和servlet提供运行环境。Jetty是使用Java语言编写的,它的 API以一组JAR包的形式发布。开发人员可以将Jetty容器实例化成一个对象,可以迅速为一些独立运行(stand-alone)的Java应用提供 网络和web连接。
Jetty 9.1 发布,支持异步Async I/O

特性

易用性

易用性是 Jetty 设计的基本原则,易用性主要体现在以下几个方面:
通过 XML 或者 API 来对Jetty进行配置;默认配置可以满足大部分的需求;将 Jetty 嵌入到应用程序当中只需要非常少的代码;

可扩展性

在使用了 Ajax 的 Web 2.0 的应用程序中,每个连接需要保持更长的时间,这样线程和内存的消耗量会急剧的增加。这就使得我们担心整个程序会因为单个组件陷入瓶颈而影响整个程序的性能。但是有了 Jetty:
即使在有大量服务请求的情况下,系统的性能也能保持在一个可以接受的状态。利用 Continuation 机制来处理大量的用户请求以及时间比较长的连接。 另外 Jetty 设计了非常良好的接口,因此在 Jetty 的某种实现无法满足用户的需要时,用户可以非常方便地对 Jetty 的某些实现进行修改,使得 Jetty 适用于特殊的应用程序的需求。

易嵌入性

Jetty 设计之初就是作为一个优秀的组件来设计的,这也就意味着 Jetty 可以非常容易的嵌入到应用程序当中而不需要程序为了使用 Jetty 做修改。从某种程度上,你也可以把 Jetty 理解为一个嵌入式的Web服务器。
Jetty 可以作为嵌入式服务器使用,Jetty的运行速度较快,而且是轻量级的,可以在Java中可以从test case中控制其运行。从而可以使自动化测试不再依赖外部环境,顺利实现自动化测试。


我们很高兴地宣布Jetty 9.1稳定版本的即时可用:

  Jetty 9.1.0.v20131115


下载:


The artifacts are also available in Maven Central.
P2 repositories should be available soon.


Documentation:

The documentation for Jetty 9.1 is still catching up, but its improving every day.

  

Jetty 9.1新的特性:


  Servlet API 3.1
    - Async I/O

  JSR-356
    - javax.websocket support

  Jetty WebSocket API
    - Streaming support
    
  Server Speed Improvements:
    - Shockingly fast response times
    
  New Async Http Client:
    - Our best yet, complete cleanup, faster than you can believe.

  New Connector Architecture:
    - We are now 100% NIO, no more blocking I/O connectors.
    - We no longer have different connectors for different protocols.
      Now you have a ServerConnector, which supports all various flavors of
      connector configurations (http, https, ssl, spdy/2, spdy/3, etc).
      Specifically architected to support new fallback techniques and upcoming
      protocols (eg: http/2 when the spec is final)

    - New module system
      Gone are OPTIONS and OPTION for managing your classpath.
      Introducing the new --module= system for enabling a module in an atomic fashion.
      See $ java -jar start.jar --help for details.

    - Cleaner and more relevant information about the server configuration
      Use $ java -jar start.jar --list-config
      
    - New ${jetty.base} support separate from ${jetty.home}
        ${jetty.home} is the directory location for the jetty distribution (the binaries).
        ${jetty.base} is the directory location for your customizations to the distribution.
      This separation allows for managing multiple jetty installations,
      as well making simple jetty installation upgrades of your jetty distribution easy.
      
      To see this in action, see the /demo-base/ directory in the distribution:
        # unpack the distribution
        [user]$ tar -zxvf jetty-distribution-9.1.0.v20131115.tar.gz
        [user]$ cd jetty-distribution-9.1.0.v20131115
        
        # switch to the demo-base directory
        [jetty-distribution-9.1.0.v20131115]$ cd demo-base
        
        # look at the configuration
        [demo-base]$ java -jar ../start.jar --list-config
        
        .. (snip/lots of output) ..
        
        # run the demo-base
        [demo-base]$ java -jar ../start.jar
</div>