Package org.apache.qpid.jms.provider
Class ConservativeProviderFuture
- java.lang.Object
-
- org.apache.qpid.jms.provider.ProviderFuture
-
- org.apache.qpid.jms.provider.ConservativeProviderFuture
-
- All Implemented Interfaces:
AsyncResult
public class ConservativeProviderFuture extends ProviderFuture
A more conservative implementation of a ProviderFuture 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 signalling.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.jms.provider.ProviderFuture
COMPLETING, error, FAILURE, INCOMPLETE, STATE_FIELD_UPDATER, SUCCESS, synchronization, waiting
-
-
Constructor Summary
Constructors Constructor Description ConservativeProviderFuture()ConservativeProviderFuture(ProviderSynchronization synchronization)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsync()Waits for a response to some Provider requested operation.booleansync(long amount, TimeUnit unit)Timed wait for a response to a Provider operation.-
Methods inherited from class org.apache.qpid.jms.provider.ProviderFuture
failOnError, isComplete, onFailure, onSuccess
-
-
-
-
Constructor Detail
-
ConservativeProviderFuture
public ConservativeProviderFuture()
-
ConservativeProviderFuture
public ConservativeProviderFuture(ProviderSynchronization synchronization)
-
-
Method Detail
-
sync
public boolean sync(long amount, TimeUnit unit) throws ProviderExceptionDescription copied from class:ProviderFutureTimed wait for a response to a Provider operation.- Specified by:
syncin classProviderFuture- Parameters:
amount- The amount of time to wait before abandoning the wait.unit- The unit to use for this wait period.- Returns:
- true if the operation succeeded and false if the waiting time elapsed while waiting for the operation to complete.
- Throws:
ProviderException- if an error occurs while waiting for the response.
-
sync
public void sync() throws ProviderExceptionDescription copied from class:ProviderFutureWaits for a response to some Provider requested operation.- Specified by:
syncin classProviderFuture- Throws:
ProviderException- if an error occurs while waiting for the response.
-
-