public interface Locker extends Service
Modifier and Type | Method and Description |
---|---|
void |
configure(PersistenceAdapter persistenceAdapter)
Optionally configure the locker with the persistence adapter currently used
You can use persistence adapter configuration details like, data directory
datasource, etc.
|
boolean |
keepAlive()
Used by a timer to keep alive the lock.
|
void |
setFailIfLocked(boolean failIfLocked)
Specify whether to fail immediately if the lock is already held.
|
void |
setLockable(LockableServiceSupport lockable)
A reference to what is locked
|
void |
setLockAcquireSleepInterval(long lockAcquireSleepInterval)
set the delay interval in milliseconds between lock acquire attempts
|
void |
setName(String name)
Set the name of the lock to use.
|
boolean keepAlive() throws IOException
IOException
void setLockAcquireSleepInterval(long lockAcquireSleepInterval)
lockAcquireSleepInterval
- the sleep interval in milisecondsvoid setFailIfLocked(boolean failIfLocked)
failIfLocked:
- true => fail immediately if the lock is held; false => block until the lock can be obtained
(default).void setLockable(LockableServiceSupport lockable)
void configure(PersistenceAdapter persistenceAdapter) throws IOException
persistenceAdapter
- IOException
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.