com.vaadin.signals.impl.
Class AsynchronousSignalTree
A signal tree that submits commands to an event log and asynchronously waits
for external confirmation before completing handling of the command. This
means that submitted
may contain changes that are not yet in
confirmed
and might never end up there if a concurrent change causes
a conflict. This type of tree is intended for signals that are synchronized
across a cluster.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.signals.impl.SignalTree
SignalTree.PendingCommit, SignalTree.Type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new asynchronous signal tree.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
confirm
(List<SignalCommand> commands) Adds a sequence of commands to the confirmed snapshot.
Gets the current snapshot based on all confirmed commands.
prepareCommit
(CommandsAndHandlers changes) Starts the process of committing a set of changes.
protected abstract void
submit
(List<SignalCommand> commands) Submits a sequence of commands to the event log.
Gets the current snapshot based on all confirmed and submitted commands.
Methods inherited from class com.vaadin.signals.impl.SignalTree
commitSingleCommand, commitSingleCommand, getLock, getWithLock, hasLock, id, notifyObservers, notifyProcessedCommandSubscribers, observeNextChange, runWithLock, subscribeToProcessed, type, wrapWithLock
-
Constructor Details
-
AsynchronousSignalTree
protected AsynchronousSignalTree()Creates a new asynchronous signal tree.
-
-
Method Details
-
submit
Submits a sequence of commands to the event log. It is expected that the same sequence of commands will eventually be passed back to
confirm(List)
.Parameters:
commands
- the list of commands to submit, notnull
-
confirm
Adds a sequence of commands to the confirmed snapshot. The commands might originate from this tree instance through
submit(List)
or from a different tree in the same cluster that uses the same underlying event log. Any remaining commands that have been submitted but not yet confirmed will be re-applied on top of the new confirmed state.Parameters:
commands
- the sequence of confirmed commands, notnull
-
prepareCommit
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 classSignalTree
Parameters:
changes
- the changes to commit, notnull
Returns:
callbacks for coordinating the rest of the commit sequence, not
null
-
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 classSignalTree
Returns:
the confirmed snapshot, not
null
-
submitted
Description copied from class:
SignalTree
Gets the current snapshot based on all confirmed and submitted commands.
Specified by:
submitted
in classSignalTree
Returns:
the submitted snapshot, not
null
-