public abstract class ResultCallbackTemplate<RC_T extends ResultCallback<A_RES_T>,A_RES_T> extends java.lang.Object implements ResultCallback<A_RES_T>
ResultCallbackResultCallback.Adapter<A_RES_T>| Constructor and Description |
|---|
ResultCallbackTemplate() |
| Modifier and Type | Method and Description |
|---|---|
RC_T |
awaitCompletion()
Blocks until
ResultCallback.onComplete() was called |
boolean |
awaitCompletion(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Blocks until
ResultCallback.onComplete() was called or the given timeout occurs |
RC_T |
awaitStarted()
Blocks until
ResultCallback.onStart(Closeable) was called. |
boolean |
awaitStarted(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Blocks until
ResultCallback.onStart(Closeable) was called or the given timeout occurs. |
void |
close() |
void |
onComplete()
Called when processing was finished either by reaching the end or by aborting it
|
void |
onError(java.lang.Throwable throwable)
Called when an exception occurs while processing
|
void |
onStart(java.io.Closeable stream)
Called when the async processing starts respectively when the response arrives from the server.
|
protected void |
throwFirstError()
Throws the first occurred error as a runtime exception
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonNextpublic void onStart(java.io.Closeable stream)
ResultCallbackCloseable can be
used to close/interrupt the processing.onStart in interface ResultCallback<A_RES_T>public void onError(java.lang.Throwable throwable)
ResultCallbackonError in interface ResultCallback<A_RES_T>public void onComplete()
ResultCallbackonComplete in interface ResultCallback<A_RES_T>public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic RC_T awaitCompletion() throws java.lang.InterruptedException
ResultCallback.onComplete() was calledjava.lang.InterruptedExceptionpublic boolean awaitCompletion(long timeout,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException
ResultCallback.onComplete() was called or the given timeout occurstrue if completed and false if the waiting time elapsed
before ResultCallback.onComplete() was called.java.lang.InterruptedExceptionpublic RC_T awaitStarted() throws java.lang.InterruptedException
ResultCallback.onStart(Closeable) was called.
ResultCallback.onStart(Closeable) is called when the request was processed on the server
side and the response is incoming.java.lang.InterruptedExceptionpublic boolean awaitStarted(long timeout,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException
ResultCallback.onStart(Closeable) was called or the given timeout occurs.
ResultCallback.onStart(Closeable) is called when the request was processed on the server side
and the response is incoming.true if started and false if the waiting time elapsed
before ResultCallback.onStart(Closeable) was called.java.lang.InterruptedExceptionprotected void throwFirstError()
DockerException - The first docker based Errorjava.lang.RuntimeException - on any other occurred errorCopyright © 2020. All Rights Reserved.