Class ConservativeClientFuture<V>
- java.lang.Object
-
- org.apache.qpid.protonj2.client.futures.ClientFuture<V>
-
- org.apache.qpid.protonj2.client.futures.ConservativeClientFuture<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 ConservativeClientFuture<V> extends ClientFuture<V>
A more conservative implementation of a ClientFuture that is better on some platforms or resource constrained hardware where high CPU usage can be more counter productive than other variants that might spin or otherwise avoid entry into states requiring thread signaling.
-
-
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 ConservativeClientFuture()
Create a newConservativeClientFuture
instance with no assignedClientSynchronization
.ConservativeClientFuture(ClientSynchronization<V> synchronization)
Create a newConservativeClientFuture
instance with the assignedClientSynchronization
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get()
V
get(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
-
ConservativeClientFuture
public ConservativeClientFuture()
Create a newConservativeClientFuture
instance with no assignedClientSynchronization
.
-
ConservativeClientFuture
public ConservativeClientFuture(ClientSynchronization<V> synchronization)
Create a newConservativeClientFuture
instance with the assignedClientSynchronization
.- Parameters:
synchronization
- theClientSynchronization
that 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:
get
in interfacejava.util.concurrent.Future<V>
- Specified by:
get
in classClientFuture<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
get
public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
get
in interfacejava.util.concurrent.Future<V>
- Specified by:
get
in classClientFuture<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
-