public class LockResult extends Object
TaskLockbox.tryLock(TaskLockType, Task, Interval)
. If the lock
acquisition fails, the callers can tell that it was failed because it was preempted by other locks of higher
priorities or not by checking the revoked
flag.
The revoked
flag means that consecutive lock acquisitions for the same dataSource and interval are
returning different locks because another lock of a higher priority preempted your lock at some point. In this case,
the lock acquisition must fail.Constructor and Description |
---|
LockResult(TaskLock taskLock,
boolean revoked) |
Modifier and Type | Method and Description |
---|---|
static LockResult |
fail(boolean revoked) |
TaskLock |
getTaskLock() |
boolean |
isOk() |
boolean |
isRevoked() |
static LockResult |
ok(TaskLock taskLock) |
public static LockResult ok(TaskLock taskLock)
public static LockResult fail(boolean revoked)
public TaskLock getTaskLock()
public boolean isRevoked()
public boolean isOk()
Copyright © 2011–2018. All rights reserved.