More robust Simantics platform shutdown logic. 69/1269/3
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 29 Nov 2017 11:07:05 +0000 (13:07 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 29 Nov 2017 20:56:57 +0000 (22:56 +0200)
commitce7ffc15e6ebcdb21089ac862aa5af01da89d454
treefc3b8676fb320dea82164dcac9795b47ecad0c70
parent5cd8adcb55ed1f9b0f5655b174eb142bf3c95dab
More robust Simantics platform shutdown logic.

Added a JVM runtime shutdown hook to ensure that unless the JVM process
is killed forcibly, the JVM should attempt properly shutting down the
Simantics platform, even if the client code that started the platform
fails to do so for any reason.

Also marked both SimanticsPlatform.{startUp,shutdown} synchronized to
prevent concurrent access to either the start-up or shutdown logic.

refs #7650

Change-Id: I8c8022730ed973d80897fb364592881425b0a51f
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java