[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: Question on programatic close of the runtime

Hi Daniel,

Am 12.03.2010 18:11, schrieb
Daniel.Stucky@xxxxxxxxxxx:
> Therefore I had the idea to provide this functionality via HTTP. So
> it's an external call that stops bundle zero and after a configurable
> timeout calls System.exit() (hopefully giving the runtime enough time
> to savely stop all bundles). So the System.exit() is done onpurpose
> by an administrator.

If it's your process and you launched it using the Equinox launcher
(launcher binary or java -jar ....) I suggest defining your own Eclipse
application.

Have a look at http://bit.ly/cPGpIq. This bundle defines a "server"
application (http://bit.ly/c8ZfZu) which simply waits for a shutdown
signal (signalShutdown). This application is executed by Equinox on
startup (similar to the workbench application). As soon as it finishes,
Equinox will shutdown cleanly. No System.exit necessary.

There is also some preliminary code for a shutdown port in there. This
shutdown signaling from an external process. That's what most Java
server processes do (eg. Tomcat).

-Gunnar

-- 
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/