Class DynamoDbLockRegistry

java.lang.Object
io.awspring.cloud.dynamodb.DynamoDbLockRegistry
All Implemented Interfaces:
org.springframework.integration.support.locks.ExpirableLockRegistry<org.springframework.integration.support.locks.DistributedLock>, org.springframework.integration.support.locks.LockRegistry<org.springframework.integration.support.locks.DistributedLock>, org.springframework.integration.support.locks.RenewableLockRegistry<org.springframework.integration.support.locks.DistributedLock>

public class DynamoDbLockRegistry extends Object implements org.springframework.integration.support.locks.ExpirableLockRegistry<org.springframework.integration.support.locks.DistributedLock>, org.springframework.integration.support.locks.RenewableLockRegistry<org.springframework.integration.support.locks.DistributedLock>
An ExpirableLockRegistry and RenewableLockRegistry implementation for the AWS DynamoDB. The algorithm is based on the DynamoDbLockRepository.
Since:
4.0
Author:
Artem Bilan, Karl Lessard, Asiel Caballero
  • Constructor Details

  • Method Details

    • setIdleBetweenTries

      public void setIdleBetweenTries(Duration idleBetweenTries)
      Specify a Duration to sleep between lock record insert/update attempts. Defaults to 100 milliseconds.
      Parameters:
      idleBetweenTries - the Duration to sleep between insert/update attempts.
    • setTimeToLive

      public void setTimeToLive(Duration ttl)
      Specify a Duration for a lock record lease expiration. Defaults to 60 seconds. This property is used as a default value Lock API without ttl argument.
      Parameters:
      ttl - the Duration for a lock record lease expiration.
    • obtain

      public org.springframework.integration.support.locks.DistributedLock obtain(Object lockKey)
      Specified by:
      obtain in interface org.springframework.integration.support.locks.LockRegistry<org.springframework.integration.support.locks.DistributedLock>
    • expireUnusedOlderThan

      public void expireUnusedOlderThan(long age)
      Specified by:
      expireUnusedOlderThan in interface org.springframework.integration.support.locks.ExpirableLockRegistry<org.springframework.integration.support.locks.DistributedLock>
    • renewLock

      public void renewLock(Object lockKey)
      Specified by:
      renewLock in interface org.springframework.integration.support.locks.RenewableLockRegistry<org.springframework.integration.support.locks.DistributedLock>
    • renewLock

      public void renewLock(Object lockKey, Duration ttl)
      Specified by:
      renewLock in interface org.springframework.integration.support.locks.RenewableLockRegistry<org.springframework.integration.support.locks.DistributedLock>
    • toString

      public String toString()
      Overrides:
      toString in class Object