Hi Piyush,

By design, a Restlet doesn't have full access to its container. It may not
even have a parent container in some cases. 

Also, in case a single container manages multiple applications, it wouldn't
be a good idea to allow Restlets in one application to shutdown the
container. In case it makes sense for your Restlet to directly shutdown the
container (administration service for example), you should simply pass the
reference of your container to your ShutdownRestlet , at construction time.

Otherwise, if you run your container using the Java Service Wrapper, you can
leverage their built-in features to start/stop/restart any service. 

Let me know if you have a different requirement or if this response doesn't
satisfy you.

Best regards,
Jerome  

> -----Message d'origine-----
> De : Piyush Purang [mailto:[EMAIL PROTECTED] 
> Envoyé : lundi 16 octobre 2006 12:01
> À : [email protected]
> Objet : Shutting down
> 
> Hi Jerome, 
> 
> I have this ShutdownRestlet that basically exits the JVM using 
> System.exit. I'd like to shutdown a bit more gracefully. 
> 
> I thought I could do something like 
> 
> restlet.getContainer().stop(); 
> 
> but with b18 I can at best get hold of the Context. 
> 
> So is there a way to exit gracefully? 
> 
> 
> Cheers 
> Piyush 
> 
> 

Reply via email to