TError - type of exceptionpublic abstract class AbstractLock<TError extends Exception> extends Object implements IAsync<TError>
| Modifier and Type | Field and Description |
|---|---|
protected CancelException |
cancel |
protected TError |
error |
protected ArrayList<Runnable> |
listeners |
| Constructor and Description |
|---|
AbstractLock() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(CancelException reason)
Cancel this object: unblock it immediately, and set the cancellation reason.
|
void |
error(TError error)
Unblock with an error.
|
Collection<?> |
getAllListeners()
Return a collection with all listeners, only for debugging purposes.
|
CancelException |
getCancelEvent()
Get the reason of the cancellation.
|
TError |
getError()
Return the error.
|
boolean |
hasError()
Return true if unblocked because of an error.
|
boolean |
isCancelled()
Return true if this object is cancelled.
|
protected abstract void |
unlock() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblock, blockException, blockPause, blockPauseCondition, blockThrow, forwardIfNotSuccessful, isDone, isSuccessful, logListenerError, onCancel, onDone, onDone, onDone, onDone, onDone, onDone, onDone, onError, onErrorOrCancel, onSuccess, thenDoOrStart, thenDoOrStart, thenDoOrStart, thenStart, thenStart, thenStart, thenStart, thenStart, thenStart, toAsyncSupplierprotected CancelException cancel
public Collection<?> getAllListeners()
IAsyncgetAllListeners in interface IAsync<TError extends Exception>protected abstract void unlock()
public final boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic final void cancel(CancelException reason)
Cancellablecancel in interface Cancellablepublic final CancelException getCancelEvent()
CancellablegetCancelEvent in interface Cancellablepublic final boolean hasError()
IAsyncCopyright © 2019. All rights reserved.