Re: JFX as an OSGi service?

2016-02-21 Thread Rahman USTA
Hi Stephen; Thanks for the documentationing it. 21 Şub 2016 21:23 tarihinde "Stephen Winnall" yazdı: > I’ve now got a subclass of javafx.application.Application that runs as an > OSGi service and references other OSGi services under Java 8SE. I’ve tried > to document it on

Re: JFX as an OSGi service?

2016-02-21 Thread Stephen Winnall
I’ve now got a subclass of javafx.application.Application that runs as an OSGi service and references other OSGi services under Java 8SE. I’ve tried to document it on Github (see https://github.com/winnall/OSGiJavaFXUsage) for the benefit of posterity. Let me know if there are any mistakes or

Re: JFX as an OSGi service?

2016-02-20 Thread Erik De Rijcke
This way only the app will be accessible by other components through the service registry. The app itself can not have any @reference because it it is javafx itself that instantiates the app object and not the osgi declarative services framework (which also takes care of injecting your

Re: JFX as an OSGi service?

2016-02-20 Thread Maurice
I make sure that the application is basically only the primary stage, therefore it only needs to publish itself. All other UI and business logic is done by other bundles. Op 20-02-16 om 15:50 schreef Stephen Winnall: I have been trying a similar approach. I’m using declarative services and I

Re: JFX as an OSGi service?

2016-02-20 Thread Stephen Winnall
I have been trying a similar approach. I’m using declarative services and I have some @References to other services in the Application, but I haven’t managed to get these instantiated. Do you have an approach for that? I suppose I can just write some code and instantiate them manually… Steve

Re: JFX as an OSGi service?

2016-02-20 Thread Maurice
That is why the bundle activator creates a bundle-singleton of itself, that way the app can access the OSGi world. In my case to register itself as a service. @Override public void start(Stage primaryStage) throws Exception { primaryStage.show();

Re: JFX as an OSGi service?

2016-02-20 Thread Stephen Winnall
Hi Maurice I have done something similar, but it has the following drawback in my view: the class launched (Udoo15App in your case) does not run under OSGi control, so it has no access to OSGi bundles or services, nor is it accessible by them. If you don’t need that, you're OK. But I need that

Re: JFX as an OSGi service?

2016-02-20 Thread Maurice
For my OSGi based JavaFX solution on the Udoo Quad (ARM based Linux) I created a service that publishes the application in the context.The application does as little as possible. It sets up the primary stage as fullscreen and puts a stackpane in it. Initially the stackpane displays a 'boot

Re: JFX as an OSGi service?

2016-02-19 Thread Stephen Winnall
Anirvan, Kevin Thanks for this. I’m an expert neither in JavaFX nor in OSGi, but I think the basis of the JavaFX/OSGi incompatibility is control. To work with OSGi, JavaFX has to relinquish control of its startup sequence to OSGi in such a way that javafx.application.Application (or its

Re: JFX as an OSGi service?

2016-02-19 Thread Kevin Rushforth
And for JDK 9 there is now: Platform.startup(Runnable); -- Kevin Anirvan Sarkar wrote: Hi Stephen, FYI, there is another way of initializing JavaFX runtime. Just use: new JFXPanel(); It is documented[1] that FX runtime is initialized when the first JFXPanel instance is constructed.

Re: JFX as an OSGi service?

2016-02-19 Thread Anirvan Sarkar
Hi Stephen, FYI, there is another way of initializing JavaFX runtime. Just use: new JFXPanel(); It is documented[1] that FX runtime is initialized when the first JFXPanel instance is constructed. Also JavaFX 9 will provide an official API to start the FX platform [2] [3]. [1]

Re: JFX as an OSGi service?

2016-02-18 Thread Stephen Winnall
Hi Erik Thanks for this - it makes sense. I was wondering about 1) getting the sub-class of javafx.application.Application to register itself at runtime as an OSGi service; or 2) trying to create a ServiceFactory that creates an instance of javafx.application.Application (perhaps decorated or

Re: JFX as an OSGi service?

2016-02-18 Thread Erik De Rijcke
Hi Stephen, We use JavaFX in an OSGi container, as a service component, in production, so it's perfectly possible. However there are a few gotcha's you need to take into account (I can not c/p the code for obvious reasons...) which makes using it in osgi... quite horrible :) When triggering a

JFX as an OSGi service?

2016-02-18 Thread Stephen Winnall
I am trying to make JavaFX 8 work with OSGi Declarative Services. My preferred solution would be to instantiate javafx.application.Application as an OSGi service. As I understand it, there are two ways of activating JavaFX: 1) sub-class javafx.application.Application or 2) call