fbrunner at gmx.ch
Wed Apr 3 14:29:56 PDT 2013
I'm not sure if it fits your needs exactly, but I've implemented something like this for Drombler FX.
The JavaFX agnostic interface is here:
The JavaFX specific implementation class and helpers are here:
So instead of calling Platform.runLater() directly, I inject an implementation of ApplicationExecuterProvider and call ApplicationExecuterProvider.getApplicationExecutor().execute().
Here is an example how you can use it with OSGi Declarative Services (using the Apache Felix SCR annotations):
(The reason I'm doing this is because Drombler ACP, the base framework of Drombler FX, is GUI-toolkit agnostic and thus doesn't know anything about JavaFX.)
Am Montag, 1. April 2013, 12.05:03 schrieb Mark Fortner:
> In the past, I've found the *Platform#runLater* method to be a useful way
> to run tasks. However, I've noticed that the code that runs my thread is
> not really configurable or accessible. For example, it would be nice to be
> able to specify and configure a top-level *ThreadPoolExecutor* to handle my
> tasks. Or be able to switch out *Executor* implementations.
> I was wondering if there was some reason for implementing runLater this
> way, or if there are any plans to change it in the future?
More information about the openjfx-dev