com.ning.http.client.providers.apache
Class ApacheResponseFuture<V>

java.lang.Object
  extended by com.ning.http.client.providers.apache.ApacheResponseFuture<V>
All Implemented Interfaces:
FutureImpl<V>, java.util.concurrent.Future<V>

public class ApacheResponseFuture<V>
extends java.lang.Object
implements FutureImpl<V>


Constructor Summary
ApacheResponseFuture(AsyncHandler<V> asyncHandler, int responseTimeoutInMs, Request request, org.apache.commons.httpclient.HttpMethodBase method)
           
 
Method Summary
 void abort(java.lang.Throwable t)
           
 boolean cancel(boolean mayInterruptIfRunning)
           
 void done(java.util.concurrent.Callable callable)
          Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.
 V get()
           
 V get(long timeout, java.util.concurrent.TimeUnit unit)
           
 Request getRequest()
           
 boolean hasExpired()
          Is the Future still valid
 boolean isCancelled()
           
 boolean isDone()
           
protected  void setInnerFuture(java.util.concurrent.Future<V> innerFuture)
           
protected  void setReaperFuture(java.util.concurrent.Future<?> reaperFuture)
           
 java.lang.String toString()
           
protected  void touch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApacheResponseFuture

public ApacheResponseFuture(AsyncHandler<V> asyncHandler,
                            int responseTimeoutInMs,
                            Request request,
                            org.apache.commons.httpclient.HttpMethodBase method)
Method Detail

setInnerFuture

protected void setInnerFuture(java.util.concurrent.Future<V> innerFuture)

done

public void done(java.util.concurrent.Callable callable)
Description copied from interface: FutureImpl
Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.

Specified by:
done in interface FutureImpl<V>

setReaperFuture

protected void setReaperFuture(java.util.concurrent.Future<?> reaperFuture)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

abort

public void abort(java.lang.Throwable t)
Specified by:
abort in interface FutureImpl<V>

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface java.util.concurrent.Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface java.util.concurrent.Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface java.util.concurrent.Future<V>

get

public V get()
      throws java.lang.InterruptedException,
             java.util.concurrent.ExecutionException
Specified by:
get in interface java.util.concurrent.Future<V>
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

get

public V get(long timeout,
             java.util.concurrent.TimeUnit unit)
      throws java.lang.InterruptedException,
             java.util.concurrent.ExecutionException,
             java.util.concurrent.TimeoutException
Specified by:
get in interface java.util.concurrent.Future<V>
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException

hasExpired

public boolean hasExpired()
Is the Future still valid

Returns:
true if response has expired and should be terminated.

touch

protected void touch()

getRequest

public Request getRequest()


Copyright © 2010. All Rights Reserved.