com.hazelcast.concurrent.lock.operations

## Class AbstractLockOperation

- java.lang.Object
- - com.hazelcast.spi.Operation
  - - com.hazelcast.concurrent.lock.operations.AbstractLockOperation

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, NamedOperation, PartitionAwareOperation, ServiceNamespaceAware
  Direct Known Subclasses:
    AwaitBackupOperation, AwaitOperation, BeforeAwaitBackupOperation, BeforeAwaitOperation, GetLockCountOperation, GetRemainingLeaseTimeOperation, IsLockedOperation, LockBackupOperation, LockOperation, SignalBackupOperation, SignalOperation, UnlockBackupOperation, UnlockOperation

      public abstract class AbstractLockOperation
      extends Operation
      implements PartitionAwareOperation, IdentifiedDataSerializable, NamedOperation, ServiceNamespaceAware, com.hazelcast.nio.serialization.impl.Versioned

- - ### Field Summary

    Fields
    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`

    - ### Fields inherited from class com.hazelcast.spi.Operation

      `GENERIC_PARTITION_ID`

  - ### Constructor Summary

    Constructors
    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)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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` | `interceptLockOperation()`
    `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)`

    - ### Methods inherited from class com.hazelcast.spi.Operation

      `afterRun, beforeRun, call, executedLocally, getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getInvocationTime, getLogger, getNodeEngine, getOperationResponseHandler, getPartitionId, getReplicaIndex, getService, getWaitTimeout, isUrgent, logError, onExecutionFailure, onInvocationException, readData, requiresExplicitServiceName, returnsResponse, run, sendResponse, setCallerUuid, setNodeEngine, setOperationResponseHandler, setPartitionId, setReplicaIndex, setService, setServiceName, setValidateTarget, setWaitTimeout, toString, validatesTarget, writeData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.spi.PartitionAwareOperation

      `getPartitionId`

    - ### Methods inherited from interface com.hazelcast.nio.serialization.IdentifiedDataSerializable

      `getId`

    - ### Methods inherited from interface com.hazelcast.nio.serialization.DataSerializable

      `readData, writeData`

- - ### Field Detail

    - #### ANY_THREAD

          public static final int ANY_THREAD

      See Also:
        Constant Field Values

    - #### namespace

          protected ObjectNamespace namespace

    - #### key

          protected Data key

    - #### threadId

          protected long threadId

    - #### leaseTime

          protected long leaseTime

    - #### response

          protected transient Object response

  - ### Constructor Detail

    - #### AbstractLockOperation

          public AbstractLockOperation()

    - #### AbstractLockOperation

          protected AbstractLockOperation(ObjectNamespace namespace,
                                          Data key,
                                          long threadId)

    - #### AbstractLockOperation

          protected AbstractLockOperation(ObjectNamespace namespace,
                                          Data key,
                                          long threadId,
                                          long timeout)

    - #### AbstractLockOperation

          public AbstractLockOperation(ObjectNamespace namespace,
                                       Data key,
                                       long threadId,
                                       long leaseTime,
                                       long timeout)

  - ### Method Detail

    - #### getResponse

          public final Object getResponse()

      Description copied from class: `Operation`
      Called if and only if `Operation.returnsResponse()` returned `true`, shortly after `Operation.run()` returns.
      Overrides:
        `getResponse` in class `Operation`

    - #### getLockStore

          protected final LockStoreImpl getLockStore()

    - #### getSyncBackupCount

          public final int getSyncBackupCount()

    - #### getAsyncBackupCount

          public final int getAsyncBackupCount()

    - #### setAsyncBackup

          public final void setAsyncBackup(boolean asyncBackup)

    - #### onSetCallId

          protected void onSetCallId(long callId)

      Description copied from class: `Operation`
      Called every time a new `callId` is set on the operation. A new `callId` is set before initial invocation and before every invocation retry.

      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`.

      Overrides:
        `onSetCallId` in class `Operation`
      Parameters:
        `callId` - the new call ID that was set on the operation

    - #### getReferenceCallId

          protected final long getReferenceCallId()

    - #### setReferenceCallId

          protected final void setReferenceCallId(long refCallId)

    - #### interceptLockOperation

          protected final void interceptLockOperation()

    - #### getServiceName

          public String getServiceName()

      Overrides:
        `getServiceName` in class `Operation`

    - #### getKey

          public final Data getKey()

    - #### getName

          public String getName()

      Description copied from interface: `NamedOperation`
      Returns the name of the distributed data structure.
      Specified by:
        `getName` in interface `NamedOperation`
      Returns:
        String name of the distributed data structure.

    - #### getServiceNamespace

          public ServiceNamespace getServiceNamespace()

      Description copied from interface: `ServiceNamespaceAware`
      Returns the `ServiceNamespace` which this object belongs to.
      Specified by:
        `getServiceNamespace` in interface `ServiceNamespaceAware`
      Returns:
        service namespace

    - #### getFactoryId

          public final int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### writeInternal

          protected void writeInternal(ObjectDataOutput out)
                                throws IOException

      Overrides:
        `writeInternal` in class `Operation`
      Throws:
        `IOException`

    - #### readInternal

          protected void readInternal(ObjectDataInput in)
                               throws IOException

      Overrides:
        `readInternal` in class `Operation`
      Throws:
        `IOException`

    - #### toString

          protected void toString(StringBuilder sb)

      Description copied from class: `Operation`
      A template method allows for additional information to be passed into the `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 to always call the super.toString(stringBuffer) when implementing this method to make sure that the super class can inject content if needed.
      Overrides:
        `toString` in class `Operation`
      Parameters:
        `sb` - the StringBuilder to add the debug info to.

Copyright © 2019. All rights reserved.