public static class PessimisticLockFactory.Builder extends Object
PessimisticLockFactory
.Modifier | Constructor and Description |
---|---|
protected |
Builder()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
PessimisticLockFactory.Builder |
acquireAttempts(int acquireAttempts)
Indicates howmany attempts should be done to acquire a lock.
|
PessimisticLockFactory |
build()
Builds the PessimisticLockFactory instance using the properties defined in this builder
|
PessimisticLockFactory.Builder |
lockAttemptTimeout(int lockAttemptTimeout)
The duration of a single attempt to acquire the internal lock.
|
PessimisticLockFactory.Builder |
queueLengthThreshold(int maximumQueued)
Defines the maximum number of queued threads to allow for this lock.
|
public PessimisticLockFactory.Builder acquireAttempts(int acquireAttempts)
lockAttemptTimeout(int)
, this defines the total timeout of a lock acquisition.
Defaults to 6000.
acquireAttempts
- The number of attempts to acquire the lockpublic PessimisticLockFactory.Builder queueLengthThreshold(int maximumQueued)
Defaults to unbounded.
maximumQueued
- The maximum number of threads to allow in the queue for this lockpublic PessimisticLockFactory.Builder lockAttemptTimeout(int lockAttemptTimeout)
acquireAttempts(int)
, this defines the total timeout of an acquisition attempt.
Defaults to 10ms.
lockAttemptTimeout
- The duration of a single aqcuisition attempt of the internal lock, in millisecondspublic PessimisticLockFactory build()
Copyright © 2010–2022. All rights reserved.