mirrormap.commands
Class UpdateCommand

java.lang.Object
  extended by mirrormap.commands.AbstractCommand
      extended by mirrormap.commands.AddCommand
          extended by mirrormap.commands.UpdateCommand
All Implemented Interfaces:
Serializable, ICommand

public final class UpdateCommand
extends AddCommand

Encapsulates a command to put a key-value entry into a MirrorMap.

Author:
Ramon Servadei
See Also:
Serialized Form

Field Summary
 
Fields inherited from class mirrormap.commands.AddCommand
value
 
Fields inherited from class mirrormap.commands.AbstractCommand
key, mirrorMapName
 
Constructor Summary
UpdateCommand()
           
UpdateCommand(String mirrorMapName, Serializable key, Serializable value)
           
 
Method Summary
protected  boolean shouldExecute(MirrorMap<Serializable,Serializable> mirrorMap)
          Determines whether the command should be executed.
 
Methods inherited from class mirrormap.commands.AddCommand
execute
 
Methods inherited from class mirrormap.commands.AbstractCommand
getBytes, getMirrorMapName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UpdateCommand

public UpdateCommand()

UpdateCommand

public UpdateCommand(String mirrorMapName,
                     Serializable key,
                     Serializable value)
Method Detail

shouldExecute

protected boolean shouldExecute(MirrorMap<Serializable,Serializable> mirrorMap)
Description copied from class: AddCommand
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)

Overrides:
shouldExecute in class AddCommand
Parameters:
mirrorMap - the mirror map affected
Returns:
true if this command should be executed


Copyright © 2010. All Rights Reserved.