public class ResponseFuture<R> extends Object implements Future<R>
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelled
flag to determine if this future is cancelled
|
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 |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
R |
get() |
R |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone()
This operation is not supported in this implementation of Future
|
void |
set(R response) |
String |
toString() |
protected BlockingQueue<R> queue
protected boolean cancelled
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<R>
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<R>
InterruptedException
- if the operation has been cancelled by clientExecutionException
TimeoutException
public boolean isCancelled()
isCancelled
in interface Future<R>
public boolean isDone()
Copyright © 2009–2014 The Apache Software Foundation. All rights reserved.