com.hazelcast.concurrent.semaphore.operations

## Class AcquireOperation

- java.lang.Object
- - com.hazelcast.spi.Operation
  - - com.hazelcast.spi.impl.AbstractNamedOperation
    - - com.hazelcast.concurrent.semaphore.operations.SemaphoreOperation
      - - com.hazelcast.concurrent.semaphore.operations.SemaphoreBackupAwareOperation
        - - com.hazelcast.concurrent.semaphore.operations.AcquireOperation

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

      public class AcquireOperation
      extends SemaphoreBackupAwareOperation
      implements BlockingOperation, com.hazelcast.spi.impl.MutatingOperation

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.concurrent.semaphore.operations.SemaphoreOperation

      `permitCount, response`

    - ### Fields inherited from class com.hazelcast.spi.impl.AbstractNamedOperation

      `name`

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

      `GENERIC_PARTITION_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AcquireOperation()`
    `AcquireOperation(String name, int permitCount, long timeout)`

  - ### 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.
    `WaitNotifyKey` | `getWaitKey()`
    `void` | `onWaitExpire()`
    `void` | `run()`
    `boolean` | `shouldBackup()` Checks if a backup needs to be made.
    `boolean` | `shouldWait()`

    - ### Methods inherited from class com.hazelcast.concurrent.semaphore.operations.SemaphoreBackupAwareOperation

      `getAsyncBackupCount, getSyncBackupCount`

    - ### Methods inherited from class com.hazelcast.concurrent.semaphore.operations.SemaphoreOperation

      `getFactoryId, getResponse, getSemaphoreContainer, getServiceName, readInternal, writeInternal`

    - ### Methods inherited from class com.hazelcast.spi.impl.AbstractNamedOperation

      `getName, 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, onSetCallId, readData, 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.PartitionAwareOperation

      `getPartitionId`

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

      `readData, writeData`

- - ### Constructor Detail

    - #### AcquireOperation

          public AcquireOperation()

    - #### AcquireOperation

          public AcquireOperation(String name,
                                  int permitCount,
                                  long timeout)

  - ### Method Detail

    - #### run

          public void run()
                   throws Exception

      Overrides:
        `run` in class `Operation`
      Throws:
        `Exception`

    - #### getWaitKey

          public WaitNotifyKey getWaitKey()

      Specified by:
        `getWaitKey` in interface `BlockingOperation`

    - #### shouldWait

          public boolean shouldWait()

      Specified by:
        `shouldWait` in interface `BlockingOperation`

    - #### onWaitExpire

          public void onWaitExpire()

      Specified by:
        `onWaitExpire` 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.

    - #### 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

Copyright © 2018. All rights reserved.