TError - type of exception it may raisepublic class LockPoint<TError extends Exception> extends Object implements ISynchronizationPoint<TError>
| Constructor and Description |
|---|
LockPoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
block(long timeout)
Pause the current thread to wait for this synchronization point to be unblocked.
|
void |
blockPause(long logAfter)
Really block, using wait method (used by threading system to know when a thread can be resumed).
|
void |
cancel(CancelException reason)
Cancel this synchronization point: 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 unblocked because of a cancellation.
|
boolean |
isUnblocked()
Return true if unblocked (success or cancelled).
|
void |
listenInline(Runnable r)
Call listener when unblocked (whatever the result is successful, has error or is cancelled).
|
void |
lock()
Request the lock.
|
void |
unlock()
Release the lock.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblockException, blockThrow, forwardCancel, isSuccessful, listenAsync, listenAsync, listenAsyncSP, listenInline, listenInline, listenInline, listenInlineSP, listenInlineSP, onCancel, onError, onException, onSuccess, synchWithNoError, toAsyncWorkVoidpublic void lock()
public void unlock()
public boolean isUnblocked()
ISynchronizationPointisUnblocked in interface ISynchronizationPoint<TError extends Exception>public void blockPause(long logAfter)
ISynchronizationPointblockPause in interface ISynchronizationPoint<TError extends Exception>public Collection<?> getAllListeners()
ISynchronizationPointgetAllListeners in interface ISynchronizationPoint<TError extends Exception>public void listenInline(Runnable r)
ISynchronizationPointlistenInline in interface ISynchronizationPoint<TError extends Exception>public void block(long timeout)
ISynchronizationPointblock in interface ISynchronizationPoint<TError extends Exception>public boolean isCancelled()
ISynchronizationPointisCancelled in interface ISynchronizationPoint<TError extends Exception>public void cancel(CancelException reason)
ISynchronizationPointcancel in interface ISynchronizationPoint<TError extends Exception>public CancelException getCancelEvent()
ISynchronizationPointgetCancelEvent in interface ISynchronizationPoint<TError extends Exception>public boolean hasError()
ISynchronizationPointhasError in interface ISynchronizationPoint<TError extends Exception>public TError getError()
ISynchronizationPointgetError in interface ISynchronizationPoint<TError extends Exception>public void error(TError error)
ISynchronizationPointerror in interface ISynchronizationPoint<TError extends Exception>Copyright © 2018. All rights reserved.