|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ning.http.client.providers.jdk.JDKFuture<V>
public class JDKFuture<V>
Field Summary | |
---|---|
protected AsyncHandler<V> |
asyncHandler
|
protected AtomicBoolean |
cancelled
|
protected AtomicBoolean |
contentProcessed
|
protected AtomicReference<Throwable> |
exception
|
protected Future<V> |
innerFuture
|
protected AtomicBoolean |
isDone
|
protected int |
responseTimeoutInMs
|
protected AtomicBoolean |
timedOut
|
protected AtomicLong |
touch
|
protected HttpURLConnection |
urlConnection
|
Constructor Summary | |
---|---|
JDKFuture(AsyncHandler<V> asyncHandler,
int responseTimeoutInMs,
HttpURLConnection urlConnection)
|
Method Summary | |
---|---|
void |
abort(Throwable t)
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future |
boolean |
cancel(boolean mayInterruptIfRunning)
|
void |
content(V v)
Set the content that will be returned by this instance |
void |
done(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,
TimeUnit unit)
|
boolean |
getAndSetWriteBody(boolean writeBody)
Write the Request body |
boolean |
getAndSetWriteHeaders(boolean writeHeaders)
Write the Request headers |
boolean |
hasExpired()
Is the Future still valid |
boolean |
isCancelled()
|
boolean |
isDone()
|
protected void |
setInnerFuture(Future<V> innerFuture)
|
void |
touch()
Touch the current instance to prevent external service to times out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Future<V> innerFuture
protected final AsyncHandler<V> asyncHandler
protected final int responseTimeoutInMs
protected final AtomicBoolean cancelled
protected final AtomicBoolean timedOut
protected final AtomicBoolean isDone
protected final AtomicReference<Throwable> exception
protected final AtomicLong touch
protected final AtomicBoolean contentProcessed
protected final HttpURLConnection urlConnection
Constructor Detail |
---|
public JDKFuture(AsyncHandler<V> asyncHandler, int responseTimeoutInMs, HttpURLConnection urlConnection)
Method Detail |
---|
protected void setInnerFuture(Future<V> innerFuture)
public void done(Callable callable)
FutureImpl
Callable
and if there is no exception, mark this Future as done and release the internal lock.
done
in interface FutureImpl<V>
public void abort(Throwable t)
FutureImpl
Throwable
to the AsyncHandler
or Future
abort
in interface FutureImpl<V>
public void content(V v)
FutureImpl
content
in interface FutureImpl<V>
v
- the content that will be returned by this instancepublic boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface Future<V>
public boolean isCancelled()
isCancelled
in interface Future<V>
public boolean isDone()
isDone
in interface Future<V>
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public boolean hasExpired()
true
if response has expired and should be terminated.public void touch()
touch
in interface FutureImpl<V>
public boolean getAndSetWriteHeaders(boolean writeHeaders)
Request
headers
getAndSetWriteHeaders
in interface FutureImpl<V>
public boolean getAndSetWriteBody(boolean writeBody)
Request
body
getAndSetWriteBody
in interface FutureImpl<V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |