| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.spi.Operation
public abstract class Operation
An operation could be compared to a Runnable. It contains logic that is going to be executed; this logic
 will be placed in the run() method.
| Field Summary | |
|---|---|
static long | 
CALL_ID_LOCAL_SKIPPED
A call id for an invocation that is skipping local registration.  | 
static int | 
GENERIC_PARTITION_ID
 | 
| Constructor Summary | |
|---|---|
Operation()
 | 
|
| Method Summary | ||
|---|---|---|
abstract  void | 
afterRun()
 | 
|
abstract  void | 
beforeRun()
 | 
|
 Address | 
getCallerAddress()
 | 
|
 String | 
getCallerUuid()
 | 
|
 long | 
getCallId()
Gets the callId of this Operation.  | 
|
 long | 
getCallTimeout()
Gets the call timeout in milliseconds.  | 
|
 Connection | 
getConnection()
 | 
|
 long | 
getInvocationTime()
Gets the time in milliseconds since this invocation started.  | 
|
protected  ILogger | 
getLogger()
 | 
|
 NodeEngine | 
getNodeEngine()
 | 
|
 int | 
getPartitionId()
Returns the id of the partition that this Operation will be executed upon.  | 
|
 int | 
getReplicaIndex()
 | 
|
abstract  Object | 
getResponse()
 | 
|
 ResponseHandler | 
getResponseHandler()
 | 
|
 | 
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)
 | 
|
 Operation | 
setNodeEngine(NodeEngine nodeEngine)
 | 
|
 Operation | 
setPartitionId(int partitionId)
Sets the partition id.  | 
|
 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 | 
| Field Detail | 
|---|
public static final int GENERIC_PARTITION_ID
public static final long CALL_ID_LOCAL_SKIPPED
| Constructor Detail | 
|---|
public Operation()
| Method Detail | 
|---|
public boolean isUrgent()
public abstract void beforeRun()
                        throws Exception
Exception
public abstract void run()
                  throws Exception
Exception
public abstract void afterRun()
                       throws Exception
Exceptionpublic abstract boolean returnsResponse()
public abstract Object getResponse()
public String getServiceName()
public final Operation setServiceName(String serviceName)
public final int getPartitionId()
setPartitionId(int)public final Operation setPartitionId(int partitionId)
partitionId - the id of the partition.
getPartitionId()public final int getReplicaIndex()
public final Operation setReplicaIndex(int replicaIndex)
public final long getCallId()
public boolean validatesTarget()
public final Operation setValidateTarget(boolean validateTarget)
public final NodeEngine getNodeEngine()
public final Operation setNodeEngine(NodeEngine nodeEngine)
public final <T> T getService()
public final Operation setService(Object service)
public final Address getCallerAddress()
public final Connection getConnection()
public final Operation setResponseHandler(ResponseHandler responseHandler)
public final ResponseHandler getResponseHandler()
public final long getInvocationTime()
ClusterClock.getClusterTime().
public final long getCallTimeout()
GroupProperties.OPERATION_CALL_TIMEOUT_MILLIS
setCallTimeout(long), 
OperationAccessor.setCallTimeout(Operation, long)public final long getWaitTimeout()
public final void setWaitTimeout(long timeout)
public ExceptionAction onException(Throwable throwable)
public String getCallerUuid()
public Operation setCallerUuid(String callerUuid)
protected final ILogger getLogger()
public void logError(Throwable e)
public final void writeData(ObjectDataOutput out)
                     throws IOException
DataSerializable
writeData in interface DataSerializableout - output
IOException
public final void readData(ObjectDataInput in)
                    throws IOException
DataSerializable
readData in interface DataSerializablein - input
IOException
protected abstract void writeInternal(ObjectDataOutput out)
                               throws IOException
IOException
protected abstract void readInternal(ObjectDataInput in)
                              throws IOException
IOExceptionpublic String toString()
toString in class Object
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||