public abstract class AbstractLockOperation extends Operation implements PartitionAwareOperation, IdentifiedDataSerializable, NamedOperation, ServiceNamespaceAware, Versioned
Modifier and Type | Field and Description |
---|---|
static int |
ANY_THREAD |
protected Data |
key |
protected long |
leaseTime |
protected ObjectNamespace |
namespace |
protected Object |
response |
protected long |
threadId |
GENERIC_PARTITION_ID
Modifier | Constructor and Description |
---|---|
|
AbstractLockOperation() |
protected |
AbstractLockOperation(ObjectNamespace namespace,
Data key,
long threadId) |
protected |
AbstractLockOperation(ObjectNamespace namespace,
Data key,
long threadId,
long timeout) |
|
AbstractLockOperation(ObjectNamespace namespace,
Data key,
long threadId,
long leaseTime,
long timeout) |
Modifier and Type | Method and Description |
---|---|
int |
getAsyncBackupCount() |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
Data |
getKey() |
protected LockStoreImpl |
getLockStore() |
String |
getName()
Returns the name of the distributed data structure.
|
protected long |
getReferenceCallId() |
Object |
getResponse()
Called if and only if
Operation.returnsResponse() returned true , shortly after Operation.run()
returns. |
String |
getServiceName() |
ServiceNamespace |
getServiceNamespace()
Returns the
ServiceNamespace which this object belongs to. |
int |
getSyncBackupCount() |
protected void |
onSetCallId(long callId)
Called every time a new callId is set on the operation.
|
protected void |
readInternal(ObjectDataInput in) |
void |
setAsyncBackup(boolean asyncBackup) |
protected void |
setReferenceCallId(long refCallId) |
protected void |
toString(StringBuilder sb)
A template method allows for additional information to be passed into the
Operation.toString() method. |
protected void |
writeInternal(ObjectDataOutput out) |
afterRun, beforeRun, call, executedLocally, getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getInvocationTime, getLogger, getNodeEngine, getOperationResponseHandler, getPartitionId, getReplicaIndex, getService, getWaitTimeout, isUrgent, logError, onExecutionFailure, onInvocationException, readData, returnsResponse, run, sendResponse, setCallerUuid, setNodeEngine, setOperationResponseHandler, setPartitionId, setReplicaIndex, setService, setServiceName, setValidateTarget, setWaitTimeout, toString, validatesTarget, writeData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPartitionId
getId
readData, writeData
public static final int ANY_THREAD
protected ObjectNamespace namespace
protected Data key
protected long threadId
protected long leaseTime
protected transient Object response
public AbstractLockOperation()
protected AbstractLockOperation(ObjectNamespace namespace, Data key, long threadId)
protected AbstractLockOperation(ObjectNamespace namespace, Data key, long threadId, long timeout)
public AbstractLockOperation(ObjectNamespace namespace, Data key, long threadId, long leaseTime, long timeout)
public final Object getResponse()
Operation
Operation.returnsResponse()
returned true
, shortly after Operation.run()
returns.getResponse
in class Operation
protected final LockStoreImpl getLockStore()
public final int getSyncBackupCount()
public final int getAsyncBackupCount()
public final void setAsyncBackup(boolean asyncBackup)
protected void onSetCallId(long callId)
Operation
By default this is a no-op method. Operation implementations which want to get notified on callId changes can override it.
For example an operation can distinguish the first invocation and invocation retries by keeping the initial callId.
onSetCallId
in class Operation
callId
- the new call ID that was set on the operationprotected final long getReferenceCallId()
protected final void setReferenceCallId(long refCallId)
public String getServiceName()
getServiceName
in class Operation
public final Data getKey()
public String getName()
NamedOperation
getName
in interface NamedOperation
public ServiceNamespace getServiceNamespace()
ServiceNamespaceAware
ServiceNamespace
which this object belongs to.getServiceNamespace
in interface ServiceNamespaceAware
public final int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
protected void writeInternal(ObjectDataOutput out) throws IOException
writeInternal
in class Operation
IOException
protected void readInternal(ObjectDataInput in) throws IOException
readInternal
in class Operation
IOException
protected void toString(StringBuilder sb)
Operation
Operation.toString()
method. So an Operation
subclass can override this method and add additional debugging content. The default implementation does nothing so
one is not forced to provide an empty implementation.
It is a good practice always to call the super.toString(stringBuffer) when implementing this method to make sure
that the super class can inject content if needed.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.