Class SherlockWithConnectorBuilder<T extends SherlockWithConnectorBuilder<?>>

java.lang.Object
com.coditory.sherlock.SherlockWithConnectorBuilder<T>

public abstract class SherlockWithConnectorBuilder<T extends SherlockWithConnectorBuilder<?>> extends Object
  • Constructor Details

    • SherlockWithConnectorBuilder

      public SherlockWithConnectorBuilder()
  • Method Details

    • withLockDuration

      @NotNull public T withLockDuration(@NotNull @NotNull Duration duration)
      Parameters:
      duration - how much time a lock should be active. When time passes lock is expired and becomes released. Default: SherlockDefaults.DEFAULT_LOCK_DURATION
      Returns:
      the instance
    • withOwnerId

      @NotNull public T withOwnerId(@NotNull @NotNull String ownerId)
      Parameters:
      ownerId - owner id used to specify who can release an acquired lock
      Returns:
      the instance
    • withOwnerIdPolicy

      @NotNull public T withOwnerIdPolicy(@NotNull @NotNull com.coditory.sherlock.OwnerIdPolicy ownerIdPolicy)
    • build

      @NotNull public abstract @NotNull Sherlock build()
      Returns:
      sherlock instance
      Throws:
      IllegalArgumentException - when some required values are missing