felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Bartlett <njbartl...@gmail.com>
Subject Re: how do I stop JavaFX bundles?
Date Thu, 14 Sep 2017 09:48:55 GMT
Calling getBundle(0).stop() does not just shut down an OSGi bundle, it shuts down the entire
OSGi framework. It’s not clear to me whether that’s what you should be doing.

As for shutting down JavaFX, you have found “Platform.exit()” but you are looking for
a better way? Maybe this question should be asked on a JavaFX forum.

Regards,
Neil


> On 14 Sep 2017, at 03:36, Chuck Davis <cjgunzel@gmail.com> 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.   ????
> 
> Anybody have suggestions?
> 
> Thanks in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message