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. ???? Anybody have suggestions? Thanks in advance.