JacpFX messaging

Messaging is an essential part of JacpFX. JacpFX components (workbench, perspectives, components) have no direct reference to each other and communicate via messages. Every component has a message box and handles it's messages sequential, similar to an actor.


To send a message the JacpFX context contains following two methods:

sending a message to yourself

private Context context;   

This can be interesting when you want to execute methods in a worker thread. (see non blocking UI)

sending a message to a specific Component


Message lifecycle

To handle a message, the JacpFX Component interfaces defines two methods which will be called sequential:

public Node handle(final Message message) {
        // runs in worker thread
        return null;


public Node postHandle(final Node arg0,
                           final Message message) {
        // runs in FX application thread
        return null;

While the "handle" method will be executed in a worker thread, the "postHandle" method is always executed on the FX application thread. For details about the Component lifecycle see the documentation about async execution