public class LockManagerTask<R extends Comparable<R>,T> extends Object implements Callable<T>
LockManager
for an operation
requiring exclusive access to one or more resources and that are willing to
pre-declare their resource requirements.Modifier and Type | Field and Description |
---|---|
protected static boolean |
INFO |
protected static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
LockManagerTask(LockManager<R> lockManager,
R[] resource,
Callable<T> target) |
Modifier and Type | Method and Description |
---|---|
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() |
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
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.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.