DataType - type of data in the queueTError - type of errorpublic class WaitingDataQueueSynchronizationPoint<DataType,TError extends Exception> extends Object implements ISynchronizationPoint<TError>
| Constructor and Description |
|---|
WaitingDataQueueSynchronizationPoint() |
| 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 |
endOfData()
Signal that no more data will be queued, so any waiting thread can be unblocked.
|
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 listener)
Call listener when unblocked (whatever the result is successful, has error or is cancelled).
|
void |
newDataReady(DataType data)
Queue a new data, which may unblock a thread waiting for it.
|
DataType |
waitForData()
To call when data is needed.
|
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 WaitingDataQueueSynchronizationPoint()
public DataType waitForData()
public void newDataReady(DataType data)
public void endOfData()
public boolean isUnblocked()
ISynchronizationPointisUnblocked 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 void listenInline(Runnable listener)
ISynchronizationPointlistenInline 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 © 2017. All rights reserved.