avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Can I shutdown Avalon with certain exceptions?
Date Tue, 16 Oct 2001 08:29:07 GMT
On Tue, 16 Oct 2001 14:33, Serge Knystautas wrote:
> Is there a special kind of exception you can throw or other call I can make
> in a block or service to signal the Avalon created JVM to shutdown
> completely (and report why)?
> Generally this would be done during the init process, but could be at other
> times.  In James there are certain problems that cannot be gracefully
> managed (like if a mail repository, file or db, can't be saved to because
> of structure problems, no more space, etc...), and a quick shutdown would
> be the best way to go.

In the init process you can just throw an exception from one of the lifecycle 
methods. This will cause James to attempt to shut down gracefully.

During runtime there is not a current way that is exposed to 
ServerApplications however there will be in the future. In the meantime you 
should be able to call System.exit() and it will gracefully detect this and 
attempt a shutdown (I think). However make sure you never expect any code 
after exit() to be executed or synchronization locks to be honoured.



"An intellectual is someone who has been educated 
beyond their intelligence."

To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

View raw message