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

java.lang.Object
  extended by org.shoal.ha.cache.impl.command.Command<K,V>
Direct Known Subclasses:
BroadcastLoadRequestCommand, LoadRequestCommand, LoadResponseCommand, RemoveCommand, ReplicationFramePayloadCommand, SaveCommand, StaleCopyRemoveCommand, UpdateDeltaCommand

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

Author:
Mahesh Kannan

Field Summary
protected  DataStoreContext<K,V> dsc
           
 
Constructor Summary
protected Command(byte opcode)
           
 
Method Summary
protected abstract  Command<K,V> createNewInstance()
           
abstract  void execute(java.lang.String initiator)
           
protected  CommandManager<K,V> getCommandManager()
           
protected  DataStoreContext<K,V> getDataStoreContext()
           
 byte getOpcode()
           
 java.lang.String getTargetName()
           
 void initialize(DataStoreContext<K,V> rs)
           
 void prepareToExecute(ReplicationInputStream ris)
           
 void prepareTransmit(DataStoreContext<K,V> ctx)
           
protected abstract  void readCommandPayload(ReplicationInputStream ris)
           
protected  void setTargetName(java.lang.String val)
           
 void write(ReplicationOutputStream globalROS)
           
protected abstract  void writeCommandPayload(ReplicationOutputStream ros)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dsc

protected DataStoreContext<K,V> dsc
Constructor Detail

Command

protected Command(byte opcode)
Method Detail

initialize

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

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 final void prepareTransmit(DataStoreContext<K,V> ctx)
                           throws java.io.IOException
Throws:
java.io.IOException

write

public final void write(ReplicationOutputStream globalROS)
                 throws java.io.IOException
Throws:
java.io.IOException

prepareToExecute

public final void prepareToExecute(ReplicationInputStream ris)
                            throws java.io.IOException,
                                   DataStoreException
Throws:
java.io.IOException
DataStoreException

writeCommandPayload

protected abstract void writeCommandPayload(ReplicationOutputStream ros)
                                     throws java.io.IOException
Throws:
java.io.IOException

readCommandPayload

protected abstract void readCommandPayload(ReplicationInputStream ris)
                                    throws java.io.IOException
Throws:
java.io.IOException

createNewInstance

protected abstract Command<K,V> createNewInstance()

execute

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


Copyright © 2010. All Rights Reserved.