com.hazelcast.spi
Class Operation

java.lang.Object
  extended by com.hazelcast.spi.Operation
All Implemented Interfaces:
DataSerializable
Direct Known Subclasses:
AbstractOperation

public abstract class Operation
extends Object
implements DataSerializable

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()
           
 com.hazelcast.nio.Address getCallerAddress()
           
 String getCallerUuid()
           
 long getCallId()
           
 long getCallTimeout()
           
 com.hazelcast.nio.Connection getConnection()
           
 String getExecutorName()
           
 long getInvocationTime()
           
protected  com.hazelcast.logging.ILogger getLogger()
           
 NodeEngine getNodeEngine()
           
 int getPartitionId()
           
 int getReplicaIndex()
           
abstract  Object getResponse()
           
 ResponseHandler getResponseHandler()
           
<T> T
getService()
           
 String getServiceName()
           
 long getStartTime()
           
 long getWaitTimeout()
           
 boolean isUrgent()
           
 void logError(Throwable e)
           
 ExceptionAction onException(Throwable throwable)
           
 void readData(com.hazelcast.nio.ObjectDataInput in)
           
protected abstract  void readInternal(com.hazelcast.nio.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)
           
 boolean validatesTarget()
           
 void writeData(com.hazelcast.nio.ObjectDataOutput out)
           
protected abstract  void writeInternal(com.hazelcast.nio.ObjectDataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operation

public Operation()
Method Detail

isUrgent

public boolean isUrgent()

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()

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()

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 com.hazelcast.nio.Address getCallerAddress()

getConnection

public final com.hazelcast.nio.Connection getConnection()

setResponseHandler

public final Operation setResponseHandler(ResponseHandler responseHandler)

getResponseHandler

public final ResponseHandler getResponseHandler()

getStartTime

public final long getStartTime()

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 com.hazelcast.logging.ILogger getLogger()

logError

public void logError(Throwable e)

writeData

public final void writeData(com.hazelcast.nio.ObjectDataOutput out)
                     throws IOException
Specified by:
writeData in interface DataSerializable
Throws:
IOException

readData

public final void readData(com.hazelcast.nio.ObjectDataInput in)
                    throws IOException
Specified by:
readData in interface DataSerializable
Throws:
IOException

writeInternal

protected abstract void writeInternal(com.hazelcast.nio.ObjectDataOutput out)
                               throws IOException
Throws:
IOException

readInternal

protected abstract void readInternal(com.hazelcast.nio.ObjectDataInput in)
                              throws IOException
Throws:
IOException


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