|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.concurrent.LockManagerTask<R,T>
public class LockManagerTask<R extends Comparable<R>,T>
Class encapsulates handshaking with the LockManager for an operation
requiring exclusive access to one or more resources and that are willing to
pre-declare their resource requirements.
| Field Summary | |
|---|---|
protected static boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
LockManagerTask(LockManager<R> lockManager,
R[] resource,
Callable<T> target)
|
|
| Method Summary | |
|---|---|
T |
call()
Acquires pre-declared locks and then runs the operation identified to the constructor. |
long |
getLockLatency()
The elapsed nanoseconds the task waited to acquire its locks. |
LockManager<R> |
getLockManager()
The LockManager. |
long |
getLockTimeout()
The timeout (milliseconds) or ZERO (0L) for an infinite timeout. |
int |
getMaxLockTries()
The maximum #of times that the task will attempt to acquire its locks (positive integer). |
R[] |
getResource()
The resource(s) that are pre-declared by the task. |
long |
setLockTimeout(long newValue)
|
int |
setMaxLockTries(int newValue)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
| Constructor Detail |
|---|
public LockManagerTask(LockManager<R> lockManager,
R[] resource,
Callable<T> target)
lockManager - The lock manager.resource - The resource(s) to be locked.target - The Runnable target that will be invoked iff the locks
are successfully acquired.| Method Detail |
|---|
public LockManager<R> getLockManager()
LockManager.
public R[] getResource()
call() will
ensure that the task as a lock on these resources before it invokes
#run() to execution the task.
public int setMaxLockTries(int newValue)
public long getLockLatency()
public int getMaxLockTries()
public long setLockTimeout(long newValue)
public long getLockTimeout()
public final T call()
throws Exception
call in interface Callable<T>null
Exception - if something goes wrong.
InterruptedException - if the current thread is interrupted.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||