System for integrating java servlets with asynchronous messages
First Claim
1. A system for asynchronous messaging between Java servlets and an HTTP client, comprising:
- a server including a servlet container, a servlet and a servlet response handler;
an HTTP interface at the servlet container that receives requests from, and sends responses to an HTTP client, wherein a request from the HTTP client is transmitted by the servlet container to the servlet; and
wherein the servlet assumes responsibility for processing the requests, includingreceiving a request from the servlet container and immediately returning a partial response data via the servlet response handler to release the servlet response handler from waiting for a complete response,setting a response code to be used with subsequent responses,releasing the response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, andsubsequently processing 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.
2 Assignments
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.
-
Citations
20 Claims
-
1. A system for asynchronous messaging between Java servlets and an HTTP client, comprising:
-
a server including a servlet container, a servlet and a servlet response handler; an HTTP interface at the servlet container that receives requests from, and sends responses to an HTTP client, wherein a request from the HTTP client is transmitted by the servlet container to the servlet; and wherein the servlet assumes responsibility for processing the requests, including receiving a request from the servlet container and immediately returning a partial response data via the servlet response handler to release the servlet response handler from waiting for a complete response, setting a response code to be used with subsequent responses, releasing the response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, and subsequently processing 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, 8, 9, 10)
-
-
11. 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 contained in a servlet container; and responding to said requests asynchronously, including the steps of receiving a request at the servlet from the servlet container and immediately returning a partial response data via a servlet response handler to release the servlet response handler from waiting for a complete response, setting a response code to be used with subsequent responses, releasing the response handler to interleave the processing of subsequent requests from the HTTP client or from other HTTP clients, and subsequently processing 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 (12, 13, 14, 15, 16, 17, 18, 19, 20)
-
Specification