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 |
setLockAcquireSleepInterval(long lockAcquireSleepInterval)
set the delay interval in milliseconds between lock acquire attempts
|
void |
setName(java.lang.String name)
Set the name of the lock to use.
|
boolean keepAlive() throws java.io.IOException
java.io.IOException
void setLockAcquireSleepInterval(long lockAcquireSleepInterval)
lockAcquireSleepInterval
- the sleep interval in milisecondsvoid setName(java.lang.String name)
void setFailIfLocked(boolean failIfLocked)
failIfLocked:
- true => fail immediately if the lock is held; false => block until the lock can be obtained
(default).void configure(PersistenceAdapter persistenceAdapter) throws java.io.IOException
persistenceAdapter
- java.io.IOException
Copyright © 2005-2013 Red Hat, Inc.. All Rights Reserved.