com.hazelcast.concurrent.lock.operations

## Class AwaitOperation

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

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, BackupAwareOperation, BlockingOperation, com.hazelcast.spi.impl.MutatingOperation, NamedOperation, PartitionAwareOperation, ServiceNamespaceAware

      public class AwaitOperation
      extends AbstractLockOperation
      implements BlockingOperation, BackupAwareOperation, com.hazelcast.spi.impl.MutatingOperation

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.concurrent.lock.operations.AbstractLockOperation

      `ANY_THREAD, key, leaseTime, namespace, response, threadId`

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

      `GENERIC_PARTITION_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AwaitOperation()`
    `AwaitOperation(ObjectNamespace namespace, Data key, long threadId, long timeout, String conditionId)`
    `AwaitOperation(ObjectNamespace namespace, Data key, long threadId, long timeout, String conditionId, long referenceId)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Operation` | `getBackupOperation()` Creates the `BackupOperation` responsible for making the backup.
    `int` | `getId()` Returns type identifier for this class.
    `ConditionKey` | `getWaitKey()`
    `void` | `onWaitExpire()`
    `protected void` | `readInternal(ObjectDataInput in)`
    `void` | `run()` Runs the operation.
    `boolean` | `shouldBackup()` Checks if a backup needs to be made.
    `boolean` | `shouldWait()`
    `protected void` | `writeInternal(ObjectDataOutput out)`

    - ### Methods inherited from class com.hazelcast.concurrent.lock.operations.AbstractLockOperation

      `getAsyncBackupCount, getFactoryId, getKey, getLockStore, getName, getReferenceCallId, getResponse, getServiceName, getServiceNamespace, getSyncBackupCount, interceptLockOperation, onSetCallId, setAsyncBackup, setReferenceCallId, toString`

    - ### 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, 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.BlockingOperation

      `getWaitTimeout`

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

      `getAsyncBackupCount, getSyncBackupCount`

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

      `getPartitionId`

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

      `readData, writeData`

- - ### Constructor Detail

    - #### AwaitOperation

          public AwaitOperation()

    - #### AwaitOperation

          public AwaitOperation(ObjectNamespace namespace,
                                Data key,
                                long threadId,
                                long timeout,
                                String conditionId)

    - #### AwaitOperation

          public AwaitOperation(ObjectNamespace namespace,
                                Data key,
                                long threadId,
                                long timeout,
                                String conditionId,
                                long referenceId)

  - ### Method Detail

    - #### run

          public void run()
                   throws Exception

      Description copied from class: `Operation`
      Runs the operation. Either the `Operation.run()` or `Operation.call()` method should be implemented; not both. Runs after wait-support, supposed to do actual operation
      Overrides:
        `run` in class `Operation`
      Throws:
        `Exception`
      See Also:
        `Operation.call()`

    - #### getWaitKey

          public ConditionKey getWaitKey()

      Specified by:
        `getWaitKey` in interface `BlockingOperation`

    - #### shouldWait

          public boolean shouldWait()

      Specified by:
        `shouldWait` in interface `BlockingOperation`

    - #### shouldBackup

          public boolean shouldBackup()

      Description copied from interface: `BackupAwareOperation`
      Checks if a backup needs to be made.

      If a call has not made any change, e.g. an AtomicLong increment with 0, no backup needs to be made.
      Specified by:
        `shouldBackup` in interface `BackupAwareOperation`
      Returns:
        true if a backup needs to be made, false otherwise.

    - #### getBackupOperation

          public Operation getBackupOperation()

      Description copied from interface: `BackupAwareOperation`
      Creates the `BackupOperation` responsible for making the backup.
      Specified by:
        `getBackupOperation` in interface `BackupAwareOperation`
      Returns:
        the created `BackupOperation` responsible for making the backup.

    - #### onWaitExpire

          public void onWaitExpire()

      Specified by:
        `onWaitExpire` in interface `BlockingOperation`

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeInternal

          protected void writeInternal(ObjectDataOutput out)
                                throws IOException

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

    - #### readInternal

          protected void readInternal(ObjectDataInput in)
                               throws IOException

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

Copyright © 2020. All rights reserved.