TError - type of exception it may raisepublic class SynchronizationPoint<TError extends Exception> extends Object implements ISynchronizationPoint<TError>
| Constructor and Description |
|---|
SynchronizationPoint()
Constructor.
|
SynchronizationPoint(boolean unblocked)
Constructor with an initial state.
|
SynchronizationPoint(CancelException cancel)
Create an unblocked point with a cancellation.
|
SynchronizationPoint(TError error)
Create an unblocked point with an error.
|
| 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.
|
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 |
reset()
Reset this synchronization point to reuse it.
|
void |
restart()
Same as the method reset except that listeners are kept.
|
void |
unblock()
Unblock this synchronization point without error.
|
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, synchWithNoError, toAsyncWorkVoidpublic SynchronizationPoint()
public SynchronizationPoint(boolean unblocked)
public SynchronizationPoint(TError error)
public SynchronizationPoint(CancelException cancel)
public void listenInline(Runnable r)
ISynchronizationPointlistenInline in interface ISynchronizationPoint<TError extends Exception>public void unblock()
public void error(TError error)
ISynchronizationPointerror in interface ISynchronizationPoint<TError extends Exception>public void cancel(CancelException reason)
ISynchronizationPointcancel in interface ISynchronizationPoint<TError extends Exception>public void block(long timeout)
ISynchronizationPointblock in interface ISynchronizationPoint<TError extends Exception>public void blockPause(long logAfter)
ISynchronizationPointblockPause in interface ISynchronizationPoint<TError extends Exception>public boolean isUnblocked()
ISynchronizationPointisUnblocked in interface ISynchronizationPoint<TError extends Exception>public boolean isCancelled()
ISynchronizationPointisCancelled in interface ISynchronizationPoint<TError extends Exception>public boolean hasError()
ISynchronizationPointhasError in interface ISynchronizationPoint<TError extends Exception>public CancelException getCancelEvent()
ISynchronizationPointgetCancelEvent in interface ISynchronizationPoint<TError extends Exception>public TError getError()
ISynchronizationPointgetError in interface ISynchronizationPoint<TError extends Exception>public void reset()
public void restart()
Copyright © 2017. All rights reserved.