mirrormap.commands
Class AddCommand
java.lang.Object
mirrormap.commands.AbstractCommand
mirrormap.commands.AddCommand
- All Implemented Interfaces:
- Serializable, ICommand
- Direct Known Subclasses:
- UpdateCommand
public class AddCommand
- extends AbstractCommand
Encapsulates a command to put a key-value entry into a MirrorMap
.
- Author:
- Ramon Servadei
- See Also:
- Serialized Form
value
protected Serializable value
- The value the command applies to
AddCommand
public AddCommand()
AddCommand
public AddCommand(String mirrorMapName,
Serializable key,
Serializable value)
execute
public final void execute()
- Description copied from interface:
ICommand
- Execute the command
shouldExecute
protected boolean shouldExecute(MirrorMap<Serializable,Serializable> mirrorMap)
- Determines whether the command should be executed. This exists to prevent
the source of a change from re-applying it when it receives the same
change back from the mirror map server (all peers receive the same
change, even the originating one)
- Parameters:
mirrorMap
- the mirror map affected
- Returns:
true
if this command should be executed
Copyright © 2010. All Rights Reserved.