R - The result type returned by this Future's get methodpublic class ResponseFuture<R extends Response> extends java.lang.Object implements java.util.concurrent.Future<Response>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancelled
flag to determine if this future is cancelled
|
protected java.lang.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 java.util.concurrent.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,
java.util.concurrent.TimeUnit unit) |
java.lang.Throwable |
getCause() |
boolean |
isCancelled() |
boolean |
isDone()
This operation is not supported in this implementation of Future.
|
void |
set(R response) |
void |
setCause(java.lang.Throwable cause)
Associate a cause to the ResponseFuture
|
java.lang.String |
toString() |
protected java.util.concurrent.BlockingQueue<R extends Response> queue
protected boolean cancelled
protected java.lang.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)
cancel in interface java.util.concurrent.Future<Response>public R get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<Response>java.lang.InterruptedException - if the operation has been cancelled by clientjava.util.concurrent.ExecutionExceptionpublic void set(R response) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException - if the operation has been cancelled by clientjava.util.concurrent.ExecutionExceptionpublic R get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<Response>java.lang.InterruptedException - if the operation has been cancelled by clientjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<Response>public boolean isDone()
isDone in interface java.util.concurrent.Future<Response>public java.lang.Throwable getCause()
public void setCause(java.lang.Throwable cause)
cause - the cause to setpublic void cancel()
public java.lang.String toString()
toString in class java.lang.Object