Jerome Louvel <contact <at> noelios.com> writes:

> 
> If you can cast the request inputstream to a Jetty class that gives you
> access to the underlying NIO channel, that might work. I haven't found the
> JettyInputStream class in the API or another way to access to the channel.
> Any clue?
> 
> Thanks,

Continuations are actually really simple in, "almost".  I merely used my
ServerServlet subclass to override the ServiceServlet.service method.  I then
did the Continuation work around the base call and stuck the contination in 
the
request properties.  This works great so far, but then the trouble.

Continuations work by throwing a jetty.RetryRequest exception.  Jetty catches
this  explicitly then will retry that exact request later.  When this happens 
I
am getting tripped up by the try/catch in StatusFilter.doHandle.  It is 
catching
any Throwable.

I spent the afternoon digging to see if can extend classes to provide my own
StatusFilter but ran into the fact that the Factory.getInstance.createHelper 
is
used inside of org.restlet.Server to set the ApplicationHelper, which creates
the StatusFilter.  I am already using a custom StatusService to handle errors,
it woul d be nice if the StatusService could provide the StatusFilter
implementation as well.  Or simply provide a way to override the
ApplicationHelper class.  Currently there does not seem to be a way w/o
re-compiling the noelius implementation.

It would be great if I could provide my own implementation ApplicationHelper,
ServerHelper, and Server.

I started down the path of overriding ServerServlet.createServer and 
subclassing
HttpServerHelper.  I copied the super implementation of createServer, but 
ran
into the fact that inside the Server constructor the ApplicationHelper was 
being
set.

Seems like the simplest solution would be to make the helper field in the
org.restlet.Server class protected so I could set it w/ my ApplicationHelper
subclass and thus use my subclassed StatusFilter class.  Maybe a better 
solution
would be to use the StatusService off of the Application for 
getting StatusFilters.

I could be barking up the wrong tree, but one of these approaches seems good. 
As being able to set a Factory instance w/o changing the resource file.

Thanks.
-Brandon

Reply via email to