com.vaadin.signals.impl.

Class SynchronousSignalTree

java.lang.Object
com.vaadin.signals.impl.SignalTree
com.vaadin.signals.impl.SynchronousSignalTree
public class SynchronousSignalTree extends SignalTree

A signal tree that immediately confirms commands without waiting for an external system to determine command ordering. This means that confirmed() and submitted() return the same value. This type of tree is intended for signals that are used only within a single JVM.

  • Constructor Details

    • SynchronousSignalTree

      public SynchronousSignalTree(boolean computedSignal)

      Creates a new synchronous signal tree.

      Parameters:

      computedSignal - true if the tree is used for backing a computed signal, false if it's a standalone tree

  • Method Details

    • confirmed

      public Snapshot confirmed()

      Description copied from class: SignalTree

      Gets the current snapshot based on all confirmed commands. This snapshot does not contain changes from commands that have been submitted but not yet confirmed.

      Specified by:

      confirmed in class SignalTree

      Returns:

      the confirmed snapshot, not null

    • submitted

      public Snapshot submitted()

      Description copied from class: SignalTree

      Gets the current snapshot based on all confirmed and submitted commands.

      Specified by:

      submitted in class SignalTree

      Returns:

      the submitted snapshot, not null

    • prepareCommit

      public SignalTree.PendingCommit prepareCommit(CommandsAndHandlers changes)

      Description copied from class: SignalTree

      Starts the process of committing a set of changes. The returned instance defines callbacks for continuing the commit procedure.

      Note that this method expects that the caller has acquired the tree lock prior to calling the method and that the lock will remain acquired while interacting with the returned object.

      Specified by:

      prepareCommit in class SignalTree

      Parameters:

      changes - the changes to commit, not null

      Returns:

      callbacks for coordinating the rest of the commit sequence, not null