You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Serge Knystautas <se...@lokitech.com> on 2001/10/16 06:33:43 UTC

Can I shutdown Avalon with certain exceptions?

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.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/


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


Re: Can I shutdown Avalon with certain exceptions?

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Peter Donald" <do...@apache.org>


> 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.

Ok, thanks.  I'll have to see what's going wrong in James's init, but I
notice that frequently if you make a mistake in the conf file, James/Avalon
will just repeatedly attempt to load the configuration until you get an
OutOfMemoryError.  I'll try to get some better information to diagnose the
problem though.

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/


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


Re: Can I shutdown Avalon with certain exceptions?

Posted by Peter Donald <do...@apache.org>.
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.

-- 
Cheers,

Pete

--------------------------------------------------
"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


Re: Can I shutdown Avalon with certain exceptions?

Posted by Paul Hammant <Pa...@yahoo.com>.
Serge,

Would it have a public constructor?  Would it extend RuntimeException? 
 If yes, it sounds like a mechanism for denial of service attack.   That 
said, malicious code would probably have to be installed by an 
administrator/assembler.

Regards,

- Paul H

- Paul H

>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.
>
>Serge Knystautas
>Loki Technologies - Unstoppable Websites
>http://www.lokitech.com/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
>




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