On Wednesday 13 September 2017 19:36:15 Chuck Davis wrote: > After a few weeks delay for knee replacement I cobbled together a program > yesterday that uses the FrameworkFactory service to create a Framework and > install 3 bundles -- all of which is working splendidly as expected. > > My first bundle is this that Renato directed me to in the last thread about > this issue which takes care of the classloading issue for JavaFX: > > https://github.com/edvin/javafx-osgi > > My second bundle creates the Stage service that Paul talked about. > > My third bundle creates a couple Scenes and depending on the button pressed > changes the Scene on the Stage. > > This basic scheme is working now. > > BUT....now I have to stop things "cleanly" as "OSGi In Action" mentions. > Unfortunately, there is no JavaFX in the book. > > My main class just installs the bundles and then is finished but does not > terminate the JVM. > > I dinked around today until I came up with the combination of > Platform.exit() followed by BundleContext.getBundle(0).stop(). Stopping > bundle 0 is apparently the accepted way to stop Felix. With this > combination both JVM instances end (my main class and the Framework) and > the visual bits and pieces disappear. It's not too elegant and I have to > believe there is a better way to shut down JavaFX bundles. ????
Why are there two JVM instances? You stop bundles using (importing) JavaFX like any other bundles. > Anybody have suggestions? I'm using the JavaFX application lifecycle to manage the OSGi framework, see this base class: https://github.com/bildschirmarbeiter/de.bildschirmarbeiter.application.osgi/blob/master/src/main/java/de/bildschirmarbeiter/application/osgi/OsgiApplication.java And a concrete application overriding configuration and bundles list: https://github.com/bildschirmarbeiter/de.bildschirmarbeiter.aem.toolbox.main/blob/master/src/main/java/de/bildschirmarbeiter/aem/toolbox/main/Toolbox.java Regards, O. > Thanks in advance. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org