System for integrating java servlets with asynchronous message
First Claim
1. A system for asynchronous messaging between Java servlets and an HTTP client, comprising:
- a server that includes a servlet container, a servlet, and a servlet response handler;
an HTTP interface at the servlet container that receives requests from an HTTP client, wherein a request from the HTTP client is transmitted by the servlet container to the servlet; and
wherein the servlet upon receiving the request from the servlet container immediately sets a response code to be used with a subsequent response, releases the response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, and then processes the original request by locating the required information, resetting the response code, and sending the information to the HTTP client via the servlet response handler.
1 Assignment
0 Petitions
Accused Products
Abstract
In a traditional application server that uses servlets, when a request is dispatched to a thread the service method of the appropriate servlet is called. When the service method returns the response is sent. This is sub-optimal in the case that an asynchronous event must occur before the response can be sent, because the thread running the servlet must block until the event occurs. The invention provides for asynchronous processing of such requests. In one embodiment, the invention provides an extension to the Servlet API which allows the service method to return (and thus the thread to be freed) before the response is ready to be sent. Then when the asynchronous event later occurs the response may be completed and sent.
51 Citations
18 Claims
-
1. A system for asynchronous messaging between Java servlets and an HTTP client, comprising:
-
a server that includes a servlet container, a servlet, and a servlet response handler;
an HTTP interface at the servlet container that receives requests from an HTTP client, wherein a request from the HTTP client is transmitted by the servlet container to the servlet; and
wherein the servlet upon receiving the request from the servlet container immediately sets a response code to be used with a subsequent response, releases the response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, and then processes the original request by locating the required information, resetting the response code, and sending the information to the HTTP client via the servlet response handler. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for asynchronous messaging between Java servlets and an HTTP client, comprising the steps of:
-
receiving a request from an HTTP client to access a servlet within a servlet container; and
immediately setting a response code to be used with a subsequent response, releasing the servlet response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, processing the original request by locating the required information, and resetting the response code, and sending the information to the HTTP client via the servlet response handler. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A computer readable medium, including instructions stored therein which w
receiving a request from an HTTP client to access a servlet within a servlet container; - and
immediately setting a response code to be used with a subsequent response, releasing the servlet response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, processing the original request by locating the required information, and resetting the response code, and sending the information to the HTTP client via the servlet response handler. - View Dependent Claims (14, 15, 16, 17, 18)
- and
Specification