Re: Detecting client's disconnection

2009-07-27 Thread Joe Nellis
Greetings,

Here is some more regarding restlets and a resource ticket pattern.  
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=42792

You'll find more regarding asynchronous operations and transactions on page 229 
of RESTful Web Services
http://oreilly.com/catalog/9780596529260/

Joe.

  - Original Message - 
  From: Stephen Groucutt 
  Newsgroups: gmane.comp.java.restlet
  To: discuss@restlet.tigris.org 
  Sent: Monday, July 27, 2009 3:17 PM
  Subject: Re: Detecting client's disconnection


  Hi,

  You might find the following article helpful:

http://benramsey.com/archives/http-status-201-created-vs-202-accepted/

  In general, I think a REST API might handle your situation (a request that 
cannot complete immediately) by returning 202 Accepted, along with either body 
content or a Location header that points to a new resource location, which the 
client would then periodically poll until the long-running request was 
completed.  I could be wrong, though...

  Steve


  On Sat, Jul 25, 2009 at 6:45 AM, John.Smith  
wrote:

Hi,
I was searching the web back and forth and i didn't find a solution to the
following problem (bear in mind that I'm making my first steps in Restlet).
Client makes a request and the computation of the response is suspended
untill another event occures. If the client disconnects when the computation
is suspended the IO/Socket Exception is thrown. How can
I handle such situation, so I can for instance clear some data structures
hold for this client?

Best regards
jgs

--
View this message in context: 
http://n2.nabble.com/Detecting-client%27s-disconnection-tp3325009p3325009.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

--

http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375504

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2376200

Re: Detecting client's disconnection

2009-07-27 Thread Stephen Groucutt
Hi,

You might find the following article helpful:

  http://benramsey.com/archives/http-status-201-created-vs-202-accepted/

In general, I think a REST API might handle your situation (a request that
cannot complete immediately) by returning 202 Accepted, along with either
body content or a Location header that points to a new resource location,
which the client would then periodically poll until the long-running request
was completed.  I could be wrong, though...

Steve

On Sat, Jul 25, 2009 at 6:45 AM, John.Smith wrote:

> Hi,
> I was searching the web back and forth and i didn't find a solution to the
> following problem (bear in mind that I'm making my first steps in Restlet).
> Client makes a request and the computation of the response is suspended
> untill another event occures. If the client disconnects when the
> computation
> is suspended the IO/Socket Exception is thrown. How can
> I handle such situation, so I can for instance clear some data structures
> hold for this client?
>
> Best regards
> jgs
>
> --
> View this message in context:
> http://n2.nabble.com/Detecting-client%27s-disconnection-tp3325009p3325009.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375504
>

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2376159

RE: Question about 'org.restlet.engine.Engine.registerHelper(ClassLoader, URL, List, Class)'

2009-07-27 Thread webpost
Hi Jerome,

[disclaimer]I haven't seen the changes you made to the code in SVN.[/disclaimer]

That catch won't do the work because the throwable I am getting 
(NoClassDefFoundError) is not an exception.

I wonder if it makes sense to replace the catch-Exception by a catch-Throwable 
or, if you prefer to be less aggressive ;-), keep the catch-Exception and add a 
catch-LinkageError.

Cheers,
Marcelo

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375190


Detecting client's disconnection

2009-07-27 Thread John.Smith
Hi,
I was searching the web back and forth and i didn't find a solution to the
following problem (bear in mind that I'm making my first steps in Restlet).
Client makes a request and the computation of the response is suspended
untill another event occures. If the client disconnects when the computation
is suspended the IO/Socket Exception is thrown. How can 
I handle such situation, so I can for instance clear some data structures
hold for this client?

Best regards
jgs

-- 
View this message in context: 
http://n2.nabble.com/Detecting-client%27s-disconnection-tp3325009p3325009.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375504


Patch for JAX-RS extension on GAE

2009-07-27 Thread Martin Krasser
Hi,

first of all, I want to say that Restlet is a great framework. Really enjoy 
working with it.

For issue 818

http://restlet.tigris.org/issues/show_bug.cgi?id=818

I attached a patch that gets the JAX-RS extension running on GAE. A description 
of the patch was added as comment. It would be great if this patch could make 
it into 2.0-M4.

Regards,
Martin

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375610


Checking for Request Entity

2009-07-27 Thread Avi Flax
Hi all, quick question:
I'm using Restlet 1.1.5 to write a quick API stub.

I want a resource to allow POST only, and to request that a request entity
be sent.

The thing that's odd is, when I use curl to test a request without an
entity, like so:

curl -v -X POST http://localhost:3000/path/to/resource

then in my Resource subclass, when I call getRequest().isEntityAvailable()
it returns true! This isn't what I expected.

Can someone explain why isEntityAvailable() is returning true in this case,
and/or suggest a different way to check whether a request entity has been
sent?

Thanks!
Avi

-- 
Avi Flax » Partner » Arc90 » http://arc90.com

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2376034