Class ProviderFuture

java.lang.Object
org.apache.qpid.jms.provider.ProviderFuture
All Implemented Interfaces:
AsyncResult
Direct Known Subclasses:
BalancedProviderFuture, ConservativeProviderFuture, ProgressiveProviderFuture

public abstract class ProviderFuture extends Object implements AsyncResult
Asynchronous Provider Future class.
  • Field Details

  • Constructor Details

    • ProviderFuture

      public ProviderFuture()
    • ProviderFuture

      public ProviderFuture(ProviderSynchronization synchronization)
  • Method Details

    • isComplete

      public boolean isComplete()
      Description copied from interface: AsyncResult
      Returns true if the AsyncResult has completed. The task is considered complete regardless if it succeeded or failed.
      Specified by:
      isComplete in interface AsyncResult
      Returns:
      returns true if the asynchronous operation has completed.
    • onFailure

      public void onFailure(ProviderException result)
      Description copied from interface: AsyncResult
      If the operation fails this method is invoked with the Exception that caused the failure.
      Specified by:
      onFailure in interface AsyncResult
      Parameters:
      result - The error that resulted in this asynchronous operation failing.
    • onSuccess

      public void onSuccess()
      Description copied from interface: AsyncResult
      If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.
      Specified by:
      onSuccess in interface AsyncResult
    • sync

      public abstract void sync() throws ProviderException
      Waits for a response to some Provider requested operation.
      Throws:
      ProviderException - if an error occurs while waiting for the response.
    • sync

      public abstract boolean sync(long amount, TimeUnit unit) throws ProviderException
      Timed wait for a response to a Provider operation.
      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.
    • failOnError

      protected void failOnError() throws ProviderException
      Throws:
      ProviderException