Nice!

The side effect of this feature is that my stopped applications would 
automatically turn on when any of their routes were accessed. That could 
actually be nice in some cases, but was problematic in my case.

Here's some code for an app class that overrides this behavior:

public class StoppableApplication extends Application
{
@Override
public void handle( Request request, Response response )
{
if( isStarted() )
super.handle( request, response );
else
response.setStatus( Status.CLIENT_ERROR_NOT_FOUND );
}
}

On 02/26/2010 06:06 AM, Jerome Louvel wrote:
>
> Hi Tal,
>
> When a call reaches a Restlet, this Restlet is automatically started 
> if it wasn’t before. In your case, you need to detach them from the 
> whole routing chain.
>
> Note that in recent milestones, we have implemented cascading 
> start/stop propagation. So when you start an application, it attempts 
> to start the whole routing graph.
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Technical Lead ~ http://www.restlet.org 
> <http://www.restlet.org/>
> Noelios Technologies ~ http://www.noelios.com <http://www.noelios.com/>
>
> *De :* Tal Liron [mailto:[email protected]]
> *Envoyé :* mercredi 24 février 2010 22:07
> *À :* [email protected]
> *Objet :* Re: Starting/stopping restlets
>
> True.
>
> So, I guess the only way to remove "turn off" routes/restlets is to 
> detach them?
>
> On Wed, Feb 24, 2010 at 2:33 PM, Stephan Koops <[email protected] 
> <mailto:[email protected]>> wrote:
>
> Hi Tal,
>
> you could do some initialization and finalization work in your own 
> Restlets.
>
> best regards
> Stephan
>
> Tal Liron schrieb:
>
> > This is a basic attribute of any Restlet, but it seems like nowhere in
> > the framework is it used.
> >
> > My expectation was that routers, filters, etc., would not pass requests
> > on to a stopped target restlet. However, it seems that stopping restlets
> > has no effect.
> >
> > Is this by design? In which case, what is the purpose of 
> starting/stopping?
> >
> > -Tal
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2451685
>  
> <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2451685>
>

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

Reply via email to