Jetty 9.1 發布,支持異步Async I/O
Jetty 是一個開源的servlet容器,它為基于Java的web內容,例如JSP和servlet提供運行環境。Jetty是使用Java語言編寫的,它的 API以一組JAR包的形式發布。開發人員可以將Jetty容器實例化成一個對象,可以迅速為一些獨立運行(stand-alone)的Java應用提供 網絡和web連接。
特性
易用性
易用性是 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>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!