public abstract class ResultCallbackTemplate<RC_T extends ResultCallback<A_RES_T>,A_RES_T> extends Object implements ResultCallback<A_RES_T>
ResultCallback
Constructor and Description |
---|
ResultCallbackTemplate() |
Modifier and Type | Method and Description |
---|---|
RC_T |
awaitCompletion()
Blocks until
ResultCallback.onComplete() was called |
RC_T |
awaitCompletion(long timeout,
TimeUnit timeUnit)
Blocks until
ResultCallback.onComplete() 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(Throwable throwable)
Called when an exception occurs while processing
|
void |
onStart(Closeable stream)
Called when the async processing starts.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onNext
public void onStart(Closeable stream)
ResultCallback
Closeable
can be used to close/interrupt the
processingonStart
in interface ResultCallback<A_RES_T>
public void onError(Throwable throwable)
ResultCallback
onError
in interface ResultCallback<A_RES_T>
public void onComplete()
ResultCallback
onComplete
in interface ResultCallback<A_RES_T>
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public RC_T awaitCompletion() throws InterruptedException
ResultCallback.onComplete()
was calledInterruptedException
public RC_T awaitCompletion(long timeout, TimeUnit timeUnit) throws InterruptedException
ResultCallback.onComplete()
was called or the given timeout occursInterruptedException
Copyright © 2015. All Rights Reserved.