| | |
| | | |
| | | |
| | | |
| | | import java.util.concurrent.Future; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.TimeoutException; |
| | | |
| | |
| | | |
| | | public int getRequestID() |
| | | { |
| | | return innerFuture.getRequestID(); |
| | | if (innerFuture instanceof FutureResult<?>) |
| | | { |
| | | FutureResult<?> tmp = (FutureResult<?>) innerFuture; |
| | | return tmp.getRequestID(); |
| | | } |
| | | else |
| | | { |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private final FutureResultImpl impl; |
| | | |
| | | private volatile FutureResult<M> innerFuture = null; |
| | | private volatile Future<?> innerFuture = null; |
| | | |
| | | // This does not need to be volatile since the inner future acts as a |
| | | // memory barrier. |
| | | private FutureResult<N> outerFuture = null; |
| | | private FutureResult<? extends N> outerFuture = null; |
| | | |
| | | |
| | | |
| | |
| | | * @param future |
| | | * The inner future. |
| | | */ |
| | | public final void setFutureResult(FutureResult<M> future) |
| | | public final void setFutureResult(Future<?> future) |
| | | { |
| | | this.innerFuture = future; |
| | | } |
| | |
| | | * If the outer request could not be invoked and processing |
| | | * should terminate. |
| | | */ |
| | | protected FutureResult<N> chainErrorResult( |
| | | protected FutureResult<? extends N> chainErrorResult( |
| | | ErrorResultException innerError, ResultHandler<? super N> handler) |
| | | throws ErrorResultException |
| | | { |
| | |
| | | * If the outer request could not be invoked and processing |
| | | * should terminate. |
| | | */ |
| | | protected abstract FutureResult<N> chainResult(M innerResult, |
| | | ResultHandler<? super N> handler) throws ErrorResultException; |
| | | protected abstract FutureResult<? extends N> chainResult( |
| | | M innerResult, ResultHandler<? super N> handler) |
| | | throws ErrorResultException; |
| | | |
| | | } |