com.hazelcast.spi
Class Operation

java.lang.Object
  extended by com.hazelcast.spi.Operation
All Implemented Interfaces:
DataSerializable, RemotePropagatable<Operation>
Direct Known Subclasses:
AbstractOperation, AbstractReplicatedMapOperation, AtomicLongBaseOperation, AtomicReferenceBaseOperation, BeginTxBackupOperation, BroadcastTxRollbackOperation, CallableTaskOperation, CancellationOperation, CheckReplicaVersion, CollectionOperation, GetMapConfigOperation, IsReplicaVersionSync, KeyBasedMapOperation, MemberCallableTaskOperation, MultiMapOperation, PurgeTxBackupOperation, QueueOperation, RecoverTxnOperation, ReplicaSyncRequest, ReplicaSyncResponse, ReplicaSyncRetryResponse, ReplicateTxOperation, RollbackTxBackupOperation, ScriptExecutorOperation, ThreadDumpOperation, UpdateManagementCenterUrlOperation, UpdateMapConfigOperation

public abstract class Operation
extends Object
implements DataSerializable, RemotePropagatable<Operation>

An operation could be compared the a Runnable. So it contains logic that is going to be executed; this logic will be placed in the run() method.


Constructor Summary
Operation()
           
 
Method Summary
abstract  void afterRun()
           
abstract  void beforeRun()
           
 Address getCallerAddress()
           
 String getCallerUuid()
           
 long getCallId()
           
 long getCallTimeout()
           
 Connection getConnection()
           
 String getExecutorName()
           
 long getInvocationTime()
           
protected  ILogger getLogger()
           
 NodeEngine getNodeEngine()
           
 int getPartitionId()
           
 int getReplicaIndex()
           
abstract  Object getResponse()
           
 ResponseHandler getResponseHandler()
           
<T> T
getService()
           
 String getServiceName()
           
 long getWaitTimeout()
           
 boolean isUrgent()
           
 void logError(Throwable e)
           
 ExceptionAction onException(Throwable throwable)
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
protected abstract  void readInternal(ObjectDataInput in)
           
abstract  boolean returnsResponse()
           
abstract  void run()
           
 Operation setCallerUuid(String callerUuid)
           
 void setExecutorName(String executorName)
           
 Operation setNodeEngine(NodeEngine nodeEngine)
           
 Operation setPartitionId(int partitionId)
           
 Operation setReplicaIndex(int replicaIndex)
           
 Operation setResponseHandler(ResponseHandler responseHandler)
           
 Operation setService(Object service)
           
 Operation setServiceName(String serviceName)
           
 Operation setValidateTarget(boolean validateTarget)
           
 void setWaitTimeout(long timeout)
           
 String toString()
           
 boolean validatesTarget()
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
protected abstract  void writeInternal(ObjectDataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operation

public Operation()
Method Detail

isUrgent

public boolean isUrgent()
Specified by:
isUrgent in interface RemotePropagatable<Operation>

beforeRun

public abstract void beforeRun()
                        throws Exception
Throws:
Exception

run

public abstract void run()
                  throws Exception
Throws:
Exception

afterRun

public abstract void afterRun()
                       throws Exception
Throws:
Exception

returnsResponse

public abstract boolean returnsResponse()
Specified by:
returnsResponse in interface RemotePropagatable<Operation>

getResponse

public abstract Object getResponse()

getServiceName

public String getServiceName()

setServiceName

public final Operation setServiceName(String serviceName)

getPartitionId

public final int getPartitionId()

setPartitionId

public final Operation setPartitionId(int partitionId)

getReplicaIndex

public final int getReplicaIndex()

setReplicaIndex

public final Operation setReplicaIndex(int replicaIndex)

getExecutorName

public String getExecutorName()

setExecutorName

public void setExecutorName(String executorName)

getCallId

public final long getCallId()
Specified by:
getCallId in interface RemotePropagatable<Operation>

validatesTarget

public boolean validatesTarget()

setValidateTarget

public final Operation setValidateTarget(boolean validateTarget)

getNodeEngine

public final NodeEngine getNodeEngine()

setNodeEngine

public final Operation setNodeEngine(NodeEngine nodeEngine)

getService

public final <T> T getService()

setService

public final Operation setService(Object service)

getCallerAddress

public final Address getCallerAddress()
Specified by:
getCallerAddress in interface RemotePropagatable<Operation>

getConnection

public final Connection getConnection()
Specified by:
getConnection in interface RemotePropagatable<Operation>

setResponseHandler

public final Operation setResponseHandler(ResponseHandler responseHandler)
Specified by:
setResponseHandler in interface RemotePropagatable<Operation>

getResponseHandler

public final ResponseHandler getResponseHandler()
Specified by:
getResponseHandler in interface RemotePropagatable<Operation>

getInvocationTime

public final long getInvocationTime()

getCallTimeout

public final long getCallTimeout()

getWaitTimeout

public final long getWaitTimeout()

setWaitTimeout

public final void setWaitTimeout(long timeout)

onException

public ExceptionAction onException(Throwable throwable)

getCallerUuid

public String getCallerUuid()

setCallerUuid

public Operation setCallerUuid(String callerUuid)

getLogger

protected final ILogger getLogger()

logError

public void logError(Throwable e)
Specified by:
logError in interface RemotePropagatable<Operation>

writeData

public final void writeData(ObjectDataOutput out)
                     throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public final void readData(ObjectDataInput in)
                    throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

writeInternal

protected abstract void writeInternal(ObjectDataOutput out)
                               throws IOException
Throws:
IOException

readInternal

protected abstract void readInternal(ObjectDataInput in)
                              throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.