|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.ldap.client.api.future.ResponseFuture<R>
R - The result type returned by this Future's get methodpublic class ResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>
A Future implementation used in LdapConnection operations.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
ResponseFuture(LdapConnection connection,
int messageId)
Creates a new instance of ResponseFuture. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected BlockingQueue<R extends org.apache.directory.api.ldap.model.message.Response> queue
protected boolean cancelled
protected Throwable cause
protected int messageId
protected LdapConnection connection
| Constructor Detail |
|---|
public ResponseFuture(LdapConnection connection,
int messageId)
connection - The LdapConnection used by the requestmessageId - The associated message ID| Method Detail |
|---|
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<org.apache.directory.api.ldap.model.message.Response>
public R get()
throws InterruptedException,
ExecutionException
get in interface Future<org.apache.directory.api.ldap.model.message.Response>InterruptedException - if the operation has been cancelled by client
ExecutionException
public void set(R response)
throws InterruptedException,
ExecutionException
InterruptedException - if the operation has been cancelled by client
ExecutionException
public R get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
get in interface Future<org.apache.directory.api.ldap.model.message.Response>InterruptedException - if the operation has been cancelled by client
ExecutionException
TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface Future<org.apache.directory.api.ldap.model.message.Response>public boolean isDone()
isDone in interface Future<org.apache.directory.api.ldap.model.message.Response>public Throwable getCause()
public void setCause(Throwable cause)
cause - the cause to setpublic void cancel()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||