public class MemoryLocksService extends java.lang.Object implements Service, Instrumentable
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
INSTRUMENTATION_GROUP |
CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout| Constructor and Description |
|---|
MemoryLocksService() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the memory locks service.
|
java.lang.Class<? extends Service> |
getInterface()
Return the public interface for the memory locks services
|
LockToken |
getReadLock(java.lang.String resource,
long wait)
Obtain a READ lock for a source.
|
LockToken |
getWriteLock(java.lang.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.
|
protected static final java.lang.String INSTRUMENTATION_GROUP
public MemoryLocksService()
public void init(Services services) throws ServiceException
init in interface Serviceservices - services instance.ServiceException - thrown if the service could not initialize.public void destroy()
public java.lang.Class<? extends Service> getInterface()
getInterface in interface ServiceMemoryLocksService.public void instrument(Instrumentation instr)
instrument in interface Instrumentableinstr - instance to instrument the memory locks service to.public LockToken getReadLock(java.lang.String resource, long wait) throws java.lang.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.java.lang.InterruptedException - thrown if the thread was interrupted while waiting.public LockToken getWriteLock(java.lang.String resource, long wait) throws java.lang.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.java.lang.InterruptedException - thrown if the thread was interrupted while waiting.Copyright © 2019 Apache Software Foundation. All Rights Reserved.