org.shoal.ha.cache.impl.command
Class Command<K,V>

java.lang.Object
  extended by org.shoal.ha.cache.impl.command.Command<K,V>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AcknowledgedCommand, LoadRequestCommand, LoadResponseCommand, NoOpCommand, RemoveExpiredCommand, RemoveExpiredResultCommand, ReplicationFramePayloadCommand, SimpleAckCommand, SizeRequestCommand, SizeResponseCommand, StaleCopyRemoveCommand

public abstract class Command<K,V>
extends java.lang.Object
implements java.io.Serializable

Author:
Mahesh Kannan
See Also:
Serialized Form

Field Summary
protected  DataStoreContext<K,V> dsc
           
protected  java.lang.String targetInstanceName
           
 
Constructor Summary
protected Command(byte opcode)
           
 
Method Summary
protected abstract  boolean beforeTransmit()
           
protected static byte[] captureState(java.lang.Object obj)
           
abstract  void execute(java.lang.String initiator)
           
protected  CommandManager<K,V> getCommandManager()
           
protected  DataStoreContext<K,V> getDataStoreContext()
           
 K getKey()
           
 java.lang.String getKeyMappingInfo()
           
 java.lang.String getName()
           
 byte getOpcode()
           
 java.lang.String getTargetName()
           
 void initialize(DataStoreContext<K,V> rs)
           
protected  boolean isArtificialKey()
           
 void onFailure()
           
 void onSuccess()
           
 void prepareTransmit(DataStoreContext<K,V> ctx)
           
protected  void setKey(K k)
           
protected  void setTargetName(java.lang.String val)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dsc

protected transient DataStoreContext<K,V> dsc

targetInstanceName

protected transient java.lang.String targetInstanceName
Constructor Detail

Command

protected Command(byte opcode)
Method Detail

initialize

public final void initialize(DataStoreContext<K,V> rs)

setKey

protected final void setKey(K k)

getKey

public final K getKey()

getDataStoreContext

protected final DataStoreContext<K,V> getDataStoreContext()

getCommandManager

protected final CommandManager<K,V> getCommandManager()

getTargetName

public java.lang.String getTargetName()

getOpcode

public final byte getOpcode()

setTargetName

protected void setTargetName(java.lang.String val)

prepareTransmit

public void prepareTransmit(DataStoreContext<K,V> ctx)
                     throws java.io.IOException
Throws:
java.io.IOException

captureState

protected static byte[] captureState(java.lang.Object obj)
                              throws DataStoreException
Throws:
DataStoreException

getKeyMappingInfo

public java.lang.String getKeyMappingInfo()

getName

public final java.lang.String getName()

execute

public abstract void execute(java.lang.String initiator)
                      throws DataStoreException
Throws:
DataStoreException

onSuccess

public void onSuccess()

onFailure

public void onFailure()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isArtificialKey

protected boolean isArtificialKey()

beforeTransmit

protected abstract boolean beforeTransmit()
                                   throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012. All Rights Reserved.