public class ListPropertyCommandFilter extends Object implements ListPropertyCommandExecutor
Each state of a list is identified by a version. A command that changes the list carries the version of the state on which is meant to be executed. If the current confirmed state of a list has a different version the command needs to be dropped. This is because there where other changes on the list which make it impossible to tell if the command can safely be applied or not.
When a list command was dropped, the sending peer can detect this and resends the adapted command (see
ReparingListPropertyCommandExecutor). If the original list command carried a reference to an observable
object, the object needs to be cached for some time on this side. This way it is ensured that the observable object
is not garbage collected. The peer re-sending the command will only re-send the dropped list command, not the command
that created the observable object.
| Constructor and Description |
|---|
ListPropertyCommandFilter(ListPropertyCommandExecutor executor,
TemporaryReferenceKeeper referenceKeeper,
ListPropertyMetaDataStore listVersions,
WeakObjectRegistry objectRegistry,
boolean useLocalVerision)
Initializes an instance with all its dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(AddToList command)
Filters the passed command and passes it to the executor when it is approved.
|
void |
execute(RemoveFromList command)
Filters the passed command and passes it to the executor when it is approved.
|
void |
execute(ReplaceInList command)
Filters the passed command and passes it to the executor when it is approved.
|
public ListPropertyCommandFilter(ListPropertyCommandExecutor executor, TemporaryReferenceKeeper referenceKeeper, ListPropertyMetaDataStore listVersions, WeakObjectRegistry objectRegistry, boolean useLocalVerision)
executor - Used to execute commands that where not dropped.referenceKeeper - Used to prevent observable objects of dropped commands from being garbage collected.listVersions - Used to retrieve the current version of local list properties.objectRegistry - Used to retrieve observable objects that need to be prevented from being garbage collected.useLocalVerision - When true the local list version is used when deciding if commands need to be filtered
out. When false, the approved list command version is used.public void execute(AddToList command)
execute in interface ListPropertyCommandExecutorcommand - The command to filterpublic void execute(RemoveFromList command)
execute in interface ListPropertyCommandExecutorcommand - The command to filterpublic void execute(ReplaceInList command)
execute in interface ListPropertyCommandExecutorcommand - The command to filterCopyright © 2016 Saxonia Systems AG. All Rights Reserved.