commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: [daemon] Can init() be called more than once in a single JVM session?
Date Mon, 23 Oct 2017 17:24:56 GMT
On 23/10/17 14:53, Andrea Lo Pumo wrote:
> Since now, I have always assumed that init() is called once, and no
> more. Now I am not sure anymore. My doubt is that init() can be called
> a second time, after destroy() has been called, for example, if the
> program is restarted by Jsvc. Is this so?

No. If jsvc performs a restart, it will be a new process.

> If yes, I should use a
> static variable "alreadyInitialized" and do nothing in init() if it is
> true, at least for things that have not to be done more than once.

Not applicable.

> A second question: when does Jsvc restart the program exactly?

If the jvm stops without jsvc explicitly stopping it.


> If I
> kill the program, or use -stop. It simply stop()s and destroy()s and
> exits. I have been able to simulate a restart using System.exit(123).

The kill probably kill jsvc.

> Are there other cases when Jsvc restarts the program?

Not to my knowledge.

Mark


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


Mime
View raw message