public class JdbcLockRegistry extends Object implements ExpirableLockRegistry
LockRegistry 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.DEFAULT_EXPIRE_UNUSED_OLDER_THEN_TIME| 构造器和说明 |
|---|
JdbcLockRegistry(LockRepository client) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
expireUnusedOlderThan(long age)
Remove locks last acquired more than 'age' ago that are not currently locked.
|
Lock |
obtain(Object lockKey)
Obtains the lock associated with the parameter object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultExpireUnusedOlderThanTimepublic JdbcLockRegistry(LockRepository client)
public Lock obtain(Object lockKey)
LockRegistryobtain 在接口中 LockRegistrylockKey - The object with which the lock is associated.public void expireUnusedOlderThan(long age)
ExpirableLockRegistryexpireUnusedOlderThan 在接口中 ExpirableLockRegistryage - the time since the lock was last obtained.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.