public class JdbcLockRegistry
extends java.lang.Object
implements org.springframework.integration.support.locks.ExpirableLockRegistry, org.springframework.integration.support.locks.RenewableLockRegistry
ExpirableLockRegistry using a shared database to co-ordinate the locks.
Provides the same semantics as the
DefaultLockRegistry, but the
locks taken will be global, as long as the underlying database supports the
"serializable" isolation level in its transactions.| Constructor and Description |
|---|
JdbcLockRegistry(LockRepository client) |
| Modifier and Type | Method and Description |
|---|---|
void |
expireUnusedOlderThan(long age) |
java.util.concurrent.locks.Lock |
obtain(java.lang.Object lockKey) |
void |
renewLock(java.lang.Object lockKey) |
void |
setIdleBetweenTries(java.time.Duration idleBetweenTries)
Specify a @link Duration} to sleep between lock record insert/update attempts.
|
public JdbcLockRegistry(LockRepository client)
public void setIdleBetweenTries(java.time.Duration idleBetweenTries)
idleBetweenTries - the Duration to sleep between insert/update attempts.public java.util.concurrent.locks.Lock obtain(java.lang.Object lockKey)
obtain in interface org.springframework.integration.support.locks.LockRegistrypublic void expireUnusedOlderThan(long age)
expireUnusedOlderThan in interface org.springframework.integration.support.locks.ExpirableLockRegistrypublic void renewLock(java.lang.Object lockKey)
renewLock in interface org.springframework.integration.support.locks.RenewableLockRegistry