R
- The result type returned by this Future's get methodpublic class ResponseFuture<R extends Response> extends Object implements Future<Response>
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelled
flag to determine if this future is cancelled
|
protected Throwable |
cause
If the request has been cancelled because of an exception it will be stored here
|
protected LdapConnection |
connection
The connection used by the request
|
protected int |
messageId
The messageID for this future
|
protected BlockingQueue<R> |
queue
the blocking queue holding LDAP responses
|
Constructor and Description |
---|
ResponseFuture(LdapConnection connection,
int messageId)
Creates a new instance of ResponseFuture.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the Future
|
boolean |
cancel(boolean mayInterruptIfRunning) |
R |
get() |
R |
get(long timeout,
TimeUnit unit) |
Throwable |
getCause() |
boolean |
isCancelled() |
boolean |
isDone()
This operation is not supported in this implementation of Future.
|
void |
set(R response) |
void |
setCause(Throwable cause)
Associate a cause to the ResponseFuture
|
String |
toString() |
protected BlockingQueue<R extends Response> queue
protected boolean cancelled
protected Throwable cause
protected int messageId
protected LdapConnection connection
public ResponseFuture(LdapConnection connection, int messageId)
connection
- The LdapConnection used by the requestmessageId
- The associated message IDpublic boolean cancel(boolean mayInterruptIfRunning)
public R get() throws InterruptedException, ExecutionException
get
in interface Future<Response>
InterruptedException
- if the operation has been cancelled by clientExecutionException
public void set(R response) throws InterruptedException, ExecutionException
InterruptedException
- if the operation has been cancelled by clientExecutionException
public R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<Response>
InterruptedException
- if the operation has been cancelled by clientExecutionException
TimeoutException
public boolean isCancelled()
isCancelled
in interface Future<Response>
public boolean isDone()
public void setCause(Throwable cause)
cause
- the cause to setpublic void cancel()
Copyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.