R - The result type returned by this Future's get methodpublic abstract class MultipleResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response> extends Object implements ResponseFuture<R>
| 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 |
|---|
MultipleResponseFuture(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)
Set the associated Response in this Future
|
void |
setCause(Throwable cause)
Associate a cause to the ResponseFuture
|
String |
toString() |
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
public MultipleResponseFuture(LdapConnection connection, int messageId)
connection - The LdapConnection used by the requestmessageId - The associated message IDpublic boolean cancel(boolean mayInterruptIfRunning)
public R get() throws InterruptedException
get in interface Future<R extends org.apache.directory.api.ldap.model.message.Response>InterruptedException - if the operation has been cancelled by clientpublic void set(R response) throws InterruptedException
set in interface ResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>response - The response to add into the FutureInterruptedException - if the operation has been cancelled by clientpublic R get(long timeout, TimeUnit unit) throws InterruptedException
get in interface Future<R extends org.apache.directory.api.ldap.model.message.Response>InterruptedException - if the operation has been cancelled by clientpublic boolean isCancelled()
isCancelled in interface Future<R extends org.apache.directory.api.ldap.model.message.Response>public boolean isDone()
public Throwable getCause()
getCause in interface ResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>public void setCause(Throwable cause)
setCause in interface ResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>cause - the cause to setpublic void cancel()
cancel in interface ResponseFuture<R extends org.apache.directory.api.ldap.model.message.Response>Copyright © 2009–2019 The Apache Software Foundation. All rights reserved.