users@jersey.java.net

Re: [Jersey] Async processing & https support

From: tarjei <tarjei_at_nu.no>
Date: Mon, 03 Aug 2009 11:15:34 +0200

Hi,
On 08/03/2009 10:38 AM, Sam Zang wrote:
>>> I would like to know if there is async processing support
>>> in Jersey.
>> What type of support do you want?
>> Comet support using Jersey is being defined in the Atmosphere project:
>> http://atmosphere.dev.java.net
>> There are also some improvements to the client side we can make for
>> supporting async. requests (currently only Future is supported) via
>> callbacks. More on this in a bit.
>
> I am thinking of the simpler case. My application does
>
> @Path("/mypath")
> public class MyResource {
>
> @POST
> @Consumes("application/json")
> @Produces("application/json")
> @Path("/checkcashing")
> public CheckCashingResponse checkcashing(CheckCashingRequest req)
> {
> ...
> }
> }
>
> The POST request may need to use remote resource
> so it could take some time.
Maybe you are looking for something like:

client: POST /someresource (post contains some kind of id)
server: 100: Continue
(client waits x ms , server spawns a future that does the work)
client: POST /someresource (post contains some kind of id)
server: 100: Continue
(server is not done yet)
client: POST /someresource (post contains some kind of id)
server: 200: Ok + reply

?

> I am looking for a way to suspend the request and
> resume it when the processing is done.

When should the request return? What is async about this? Remember that
resources are not singletons but are created for every request.

Regards,
Tarjei

>
> I will take a look at Atmosphere project in the mean time.
>
>>
>>
>>> Also, I need to use SSL protocol. Does anyone have an example
>>> to host Jersey in a web container that supports https?
>>>
>>
>> There are two samples using Glassfish and Grizzly:
>>
>> http://download.java.net/maven/2/com/sun/jersey/samples/https-server-glassfish/1.1.1-ea/https-server-glassfish-1.1.1-ea-project.zip
>>
>>
>> http://download.java.net/maven/2/com/sun/jersey/samples/https-clientserver-grizzly/1.1.1-ea/https-clientserver-grizzly-1.1.1-ea-project.zip
>>
>>
>> Paul.
>
> Thanks for the info.
>
> Sam.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>


-- 
Tarjei Huse
Mobil: 920 63 413