|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.service.MemoryLocksService
public class MemoryLocksService
Field Summary |
---|
Fields inherited from interface org.apache.oozie.service.Service |
---|
CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND |
Constructor Summary | |
---|---|
MemoryLocksService()
|
Method Summary | |
---|---|
void |
destroy()
Destroy the memory locks service. |
Class<? extends Service> |
getInterface()
Return the public interface for the memory locks services |
MemoryLocks.LockToken |
getReadLock(String resource,
long wait)
Obtain a READ lock for a source. |
MemoryLocks.LockToken |
getWriteLock(String resource,
long wait)
Obtain a WRITE lock for a source. |
void |
init(Services services)
Initialize the memory locks service |
void |
instrument(Instrumentation instr)
Instruments the memory locks service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryLocksService()
Method Detail |
---|
public void init(Services services)
init
in interface Service
services
- services instance.public void destroy()
destroy
in interface Service
public Class<? extends Service> getInterface()
getInterface
in interface Service
MemoryLocksService
.public void instrument(Instrumentation instr)
instrument
in interface Instrumentable
instr
- instance to instrument the memory locks service to.public MemoryLocks.LockToken getReadLock(String resource, long wait) throws InterruptedException
resource
- resource name.wait
- time out in milliseconds to wait for the lock, -1 means no timeout and 0 no wait.
null
if the lock could not be obtained.
InterruptedException
- thrown if the thread was interrupted while waiting.public MemoryLocks.LockToken getWriteLock(String resource, long wait) throws InterruptedException
resource
- resource name.wait
- time out in milliseconds to wait for the lock, -1 means no timeout and 0 no wait.
null
if the lock could not be obtained.
InterruptedException
- thrown if the thread was interrupted while waiting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |