Class ObjectLockBuilder


  • public class ObjectLockBuilder
    extends Object
    Constructs new ObjectLock instances
    • Constructor Detail

      • ObjectLockBuilder

        public ObjectLockBuilder()
    • Method Detail

      • waitTime

        public ObjectLockBuilder waitTime​(long waitTime,
                                          TimeUnit timeUnit)
        Used to override the amount of time the client will wait to obtain an object lock. Default: 10 seconds.
        Parameters:
        waitTime - wait time
        timeUnit - unit of time
        Returns:
        builder
      • dataSource

        public ObjectLockBuilder dataSource​(DataSource dataSource)
        Sets the DataSource to use for DB based locking. This MUST be set in order to create a DB lock.
        Parameters:
        dataSource - the DataSource to use
        Returns:
        builder
      • tableName

        public ObjectLockBuilder tableName​(String tableName)
        Sets the name of the table to use for object locking. Default: ocfl_object_lock
        Parameters:
        tableName - the table name to use
        Returns:
        builder
      • build

        public ObjectLock build()
        Constructs a new ObjectLock. If a DataSource was set, then a DB lock is created; otherwise, an in-memory lock is used.
        Returns:
        object lock