public interface Completion
A Completion represents some task that is going to be completed at some
point in the future, or maybe already has completed. It is similar to
Future but without any options for
cancellation or returning a result. Indeed, you cannot even precisely tell
if the task has already completed, but the await methods will return
immediately if that is the case.
LifecycledPool.shutdown()| Modifier and Type | Method and Description |
|---|---|
boolean |
await(Timeout timeout)
Causes the current thread to wait until the completion is finished,
or the thread is
interrupted, or the specified
waiting time elapses. |
boolean await(Timeout timeout) throws InterruptedException
Causes the current thread to wait until the completion is finished,
or the thread is interrupted, or the specified
waiting time elapses.
If the task represented by this completion has already completed,
the method immediately returns true.
If the current thread already has its interrupted status set upon entry
to this method, or the thread is interrupted while waiting, then an
InterruptedException is thrown and the current threads interrupted
status is cleared.
If the specified waiting time elapses, then the method returns false.
timeout - The timeout delimiting the maximum time to wait for the
task to complete. Timeouts with zero or negative values will cause the
method to return immediately.true if the task represented by this completion
completed within the specified waiting time, or was already complete upon
entry to this method; or false if the specified Timeout
elapsed before the task could finished.InterruptedException - if the current thread is interrupted while
waiting.IllegalArgumentException - if the provided timeout parameter is
null.Copyright © 2011-2014–2015. All rights reserved.