public class MetaModel extends Object
| Constructor and Description |
|---|
MetaModel(TopologyLayerCallback topology)
Creates a
MetaModel where the root object of the domain model is received from another node. |
MetaModel(TopologyLayerCallback topology,
Object root)
Creates a
MetaModel which serves a new domain model. |
| Modifier and Type | Method and Description |
|---|---|
void |
commandsForDomainModel(CommandsForDomainModelCallback callback)
This method creates the commands necessary to reproduce the entire domain model.
|
void |
execute(List<Command> commands)
Executes commands to change the domain model of the user.
|
public MetaModel(TopologyLayerCallback topology)
MetaModel where the root object of the domain model is received from another node.topology - used to interact with the lower layer which is probably represented by the class that called this
constructor.public MetaModel(TopologyLayerCallback topology, Object root)
MetaModel which serves a new domain model.topology - see MetaModel(TopologyLayerCallback)root - The root object of the domain model that should be served.MetaModel(TopologyLayerCallback)public void execute(List<Command> commands)
This method is not Thread-safe. All callers must make sure that this method is called sequentially e.g by using a single-thread executor. The thread in which this method is called will also be used to execute changes on JavaFX properties so clients that have bound the GUI to properties of the domain model should make sure that this method is called in the JavaFX GUI thread.
These commands have usually been created by an other instance of MetaModel in an other JVM which send
them via TopologyLayerCallback.sendCommands(List) or produced them through
commandsForDomainModel(CommandsForDomainModelCallback).
commands - The commands that should be executed.public void commandsForDomainModel(CommandsForDomainModelCallback callback)
The API of this method may looks a bit odd as the commands produced are returned via a callback instead of return but this is necessary to ensure that no updated are lost for newly connecting peers.
Make sure that commands you receive via TopologyLayerCallback.sendCommands(List) are not send to the peer
you've requested this initial set of commands for before your callback is called. Make also sure that future
calls of TopologyLayerCallback.sendCommands(List) will send the changes to this new peer before your
callback returns.
It is guaranteed that your callback is only called once and that this call happens before
commandsForDomainModel(CommandsForDomainModelCallback) returns.
callback - The callback that takes the commands.Copyright © 2015 Saxonia Systems AG. All Rights Reserved.