On Thursday 14 September 2017 08:56:42 Chuck Davis wrote: > Hi Oliver: Hi Chuck,
> Where were you a couple months ago when we were discussing this??? 😚 https://www.mail-archive.com/[email protected]/msg17904.html > I like your approach...it's clean and appears to cover all the bases we > were discussing. I'm going to plagiarize from you which I assume is ok > since you've made your work public.... It's all licensed under Apache License 2.0 (there should be a license file in each repo). > Thanks so much for sharing your approach. HTH, O. > On Thu, Sep 14, 2017 at 3:35 AM, Oliver Lietz <[email protected]> wrote: > > 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: [email protected] > > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

