Listening to SimpleListProperty<T> updates from a JavaFX Service
<p>I have a JavaFX service and I want to be notified via a callback when the Service updates a custom property.  Normally the way this is done is that the service has some built in properties like "state", "workDone", "value" etc.  The one most similar to the one I want to emulate is the "value" named property.   The "value" property is defined as follows in the service class.</p>

<pre><code>    private final ObjectProperty&lt;V&gt; value = new SimpleObjectProperty&lt;&gt;(this, "value");
    @Override public final V getValue() { checkThread(); return value.get(); }
    @Override public final ReadOnlyObjectProperty&lt;V&gt; valueProperty() { checkThread(); return value; }


In my case I needed to listen to updates to a pair of message objects being updated by my JavaFX service thread, so I added a custom named property for each one as shown below.

    // add 'heartbeat' bound property
    private final ObjectProperty&lt;CAServiceHeartbeatMessage&gt; heartbeat = 
        new SimpleObjectProperty&lt;&gt;(this, "heartbeat", null);    
    public CAServiceHeartbeatMessage getHeartbeat() {
        return heartbeat.get();
    }
    public void setHeartbeatMessage(CAServiceHeartbeatMessage aHeartbeat) {
        heartbeat.set(aHeartbeat);
    }
    public ObjectProperty&lt;CAServiceHeartbeatMessage&gt; heartbeatProperty() {
        return heartbeat;
    }

    // add 'memberSystemStatus' bound property
    private final ObjectProperty&lt;MemberSystemStatusMessage&gt; memberSystemStatus = 
        new SimpleObjectProperty&lt;&gt;(this, "memberStatus", null);   
    public MemberSystemStatusMessage getMemberStatus() {
        return memberSystemStatus.get();
    }
    public void setMemberSystemMessage(MemberSystemStatusMessage aMemberSystemStatus) {
        memberSystemStatus.set(aMemberSystemStatus);
    }
    public ObjectProperty&lt;MemberSystemStatusMessage&gt; memberSystemStatusProperty() {
        return memberSystemStatus;
    }    
</code></pre>

<p>Then in the Controller class I added the following code to update the GUI based on changes to each of these properties:</p>

<pre><code>// heartbeatMessageProperty listener
// Update the GUI widgets when a new CAServiceHeartbeatMessage (heartbeatMessage) is updated
mListenerService.heartbeatProperty().addListener(
    (ObservableValue&lt;? extends CAServiceHeartbeatMessage&gt; observer, 
    CAServiceHeartbeatMessage oldValue, CAServiceHeartbeatMessage newValue) -&gt; {
    // this is where we need to intelligently update the appropriate 
    // heartbeat service entries
    System.out.println("updated CAServiceHeartbeatMessage");
});

// 'memberSystemMessage' bound property listener
mListenerService.memberSystemStatusProperty().addListener(
    (ObservableValue&lt;? extends MemberSystemStatusMessage&gt; observer, 
    MemberSystemStatusMessage oldValue, MemberSystemStatusMessage newValue) -&gt; {
    if (newValue == null) {
</code></pre>

<p>. . .</p>

<p>My question is, how can I replace multiple <code>SimpleObjectProperties</code> to use a single <code>SimpleListProperty</code>s or an <code>SimpleMapProperty</code> in my JavaFX Service class.   I'm not sure how, or whether I need to follow some property naming convention to expose some simple list property in my thread like I did with the 2 specific and separately named message properties.  IT is probably worth noting that these messages share a common base message class - so they could be stored in a simple list type.  I would also like to see an example of how I might handle the updates so that I can update the GUI when the changes occur, in particular I don'w know how to determine which of the elements in the list or map changed.</p>