- Java EE 8 High Performance
- Romain Manni Bucau
- 176字
- 2021-06-30 19:14:28
The router
JAX-RS is command-oriented. It means that a request must be bound to a Java method. To do so, the matching takes multiple parameters of the request into account:
- The patch
- The Accept header
- The Content-Type header
Here is the simplified algorithm for routing:
- Find the class matching the request based on the path (this is a regex-like logic).
- From the class found in step 1, find the method matching the request based on the path. (This is close to step 1 but applied to methods with subresource handling.)
- From the methods found in step 2, find the one that will handle the request based on mime types (Accept/Content-Type headers). This level parses the media types to handle the quality of service options (q, qs, and so on) of the header.
This is not a complicated algorithm, but it is quite dynamic and depends on the incoming requests. So most of the time, it is done at runtime by the providers and can add a small overhead, which you can notice during benchmarks.
推薦閱讀
- Citrix XenApp Performance Essentials
- Implementing Cisco UCS Solutions
- Haskell Financial Data Modeling and Predictive Analytics
- Extending Puppet
- Linux Shell編程從入門到精通(第2版)
- 高性能Linux服務器構建實戰:系統安全、故障排查、自動化運維與集群架構
- Linux運維最佳實踐
- 網絡操作系統教程:Windows Server 2016管理與配置
- Joomla! 3 Template Essentials
- Dreamweaver CS5.5 Mobile and Web Development with HTML5,CSS3,and jQuery
- Windows 7案例教程
- VMware NSX Cookbook
- 完美應用RHEL 8
- Linux軟件管理平臺設計與實現
- 從零開始學安裝與重裝系統