Class ProgressiveClientFuture<V>
- java.lang.Object
-
- org.apache.qpid.protonj2.client.futures.ClientFuture<V>
-
- org.apache.qpid.protonj2.client.futures.ProgressiveClientFuture<V>
-
- Type Parameters:
V- The type that result from completion of this Future
- All Implemented Interfaces:
java.util.concurrent.Future<V>,AsyncResult<V>
public class ProgressiveClientFuture<V> extends ClientFuture<V>
An optimized version of a ClientFuture that makes use of spin waits and other methods of reacting to asynchronous completion in a more timely manner.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.protonj2.client.futures.ClientFuture
CANCELLED, COMPLETING, error, FAILURE, INCOMPLETE, result, STATE_FIELD_UPDATER, SUCCESS, synchronization, waiting
-
-
Constructor Summary
Constructors Constructor Description ProgressiveClientFuture()Create a newProgressiveClientFutureinstance with no assignedClientSynchronization.ProgressiveClientFuture(ClientSynchronization<V> synchronization)Create a newProgressiveClientFutureinstance with the assignedClientSynchronization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vget()Vget(long amount, java.util.concurrent.TimeUnit unit)-
Methods inherited from class org.apache.qpid.protonj2.client.futures.ClientFuture
cancel, complete, failed, getResult, getState, isCancelled, isComplete, isDone, isFailed, isNotComplete, tryCancelTask
-
-
-
-
Constructor Detail
-
ProgressiveClientFuture
public ProgressiveClientFuture()
Create a newProgressiveClientFutureinstance with no assignedClientSynchronization.
-
ProgressiveClientFuture
public ProgressiveClientFuture(ClientSynchronization<V> synchronization)
Create a newProgressiveClientFutureinstance with the assignedClientSynchronization.- Parameters:
synchronization- theClientSynchronizationthat should be notified upon completion of this future.
-
-
Method Detail
-
get
public V get(long amount, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Specified by:
getin classClientFuture<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException
-
get
public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Specified by:
getin classClientFuture<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
-
-