Module org.refcodes.io
Package org.refcodes.io
Interface IOResultAccessor<RES,EXC extends Exception>
- Type Parameters:
RES
- The type of the result to be used.EXC
- The exception thrown in case no result is available. UseRuntimeException
to prevent forcing a try/catch block.
- All Superinterfaces:
org.refcodes.mixin.ResultAccessor<RES,
EXC>
public interface IOResultAccessor<RES,EXC extends Exception>
extends org.refcodes.mixin.ResultAccessor<RES,EXC>
Extends the
ResultAccessor
interface with an I/O timeout mechanism.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ResultAccessor
org.refcodes.mixin.ResultAccessor.ResultBuilder<RES extends Object,
B extends org.refcodes.mixin.ResultAccessor.ResultBuilder<RES, B>>, org.refcodes.mixin.ResultAccessor.ResultMutator<RES extends Object>, org.refcodes.mixin.ResultAccessor.ResultProperty<RES extends Object, EXC extends Exception> -
Method Summary
Modifier and TypeMethodDescriptiondefault void
waitForResult
(long aTimeoutMillis) Waits for the result.Methods inherited from interface org.refcodes.mixin.ResultAccessor
getResult, hasResult, waitForResult
-
Method Details
-
waitForResult
default void waitForResult(long aTimeoutMillis) throws InterruptedException, org.refcodes.exception.TimeoutIOException Waits for the result. This method blocks till a result is available, the timeout has run out or an exception has been thrown in case there is none such result. UseResultAccessor.hasResult()
to test beforehand whether we already have a result.- Parameters:
aTimeoutMillis
- The timeout to wait for a result- Throws:
InterruptedException
- the interrupted exceptionorg.refcodes.exception.TimeoutIOException
- thrown in ca
-