Skip to content

Load Spring Context within JavaFx Thread or not ? #36

Open
@ouaibsky

Description

@ouaibsky

This is more to start a discussion:

  • At the beginning the spring context was loaded from the javafx thread. That was nice but generates 2 concerns

    • You'll load some none non UI beans into graphic thread. That's could take some times and liekly not relevant.
    • It was more or less impossible to use splashscreen (with progress feedback) when your spring ctx loading take time (due to previous point)
  • Then Spring Ctx is now loaded from another thread that generate other concerns (even if now splash-screen is working fine)

    • All @FXMLView / Controller are loaded by spring (they are flagged as @component)
      • Meaning all UI are loaded by a non graphic thread (not sure it's a best practice)
    • We are struggled when u want to used WebEngine or GlyphFont (controlsfx) because there are checking in their constructor to be instantiate by JavaFx thread.

There is pro and cons in both solution
I don't know how to solve that properly.
Right now I did a dirty hack: where I instantiate some UI bean by delegating to JavaFx thread and blocking current thread until it's finished :-(

Any views ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions