public abstract class Request extends Object implements NotifyingFuture, Condition
Modifier and Type | Field and Description |
---|---|
protected CondVar |
cond
Is set as soon as the request has received all required responses
|
protected RequestCorrelator |
corr |
protected boolean |
done |
protected FutureListener |
listener |
protected Lock |
lock |
protected static Log |
log |
protected RequestOptions |
options |
protected long |
req_id |
protected long |
start_time |
Constructor and Description |
---|
Request(RequestCorrelator corr,
RequestOptions options) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected void |
checkCompletion(Future future) |
boolean |
execute(Message req,
boolean block_for_results) |
boolean |
getResponsesComplete() |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isMet()
Return true if the condition is met and false otherwise
|
abstract void |
receiveResponse(Object response_value,
Address sender,
boolean is_exception) |
long |
requestId() |
Request |
requestId(long req_id) |
protected abstract boolean |
responsesComplete() |
protected boolean |
responsesComplete(long timeout)
This method runs with lock locked (called by
execute() ). |
protected abstract void |
sendRequest(Message request_msg) |
NotifyingFuture |
setListener(FutureListener listener)
Attaches a listener and returns the same future instance, to allow for 'building' futures.
|
Request |
setResponseFilter(RspFilter filter) |
abstract void |
siteUnreachable(String site) |
abstract void |
suspect(Address mbr) |
String |
toString() |
abstract void |
transportClosed() |
abstract void |
viewChange(View new_view) |
protected boolean |
waitForResults(long timeout) |
protected static final Log log
protected long req_id
protected final Lock lock
protected final CondVar cond
protected final RequestCorrelator corr
protected final RequestOptions options
protected volatile boolean done
protected volatile FutureListener listener
protected long start_time
public Request(RequestCorrelator corr, RequestOptions options)
public Request requestId(long req_id)
public long requestId()
public NotifyingFuture setListener(FutureListener listener)
NotifyingFuture
setListener
in interface NotifyingFuture
listener
- listener to attachpublic boolean execute(Message req, boolean block_for_results) throws Exception
Exception
protected abstract void sendRequest(Message request_msg) throws Exception
Exception
public abstract void receiveResponse(Object response_value, Address sender, boolean is_exception)
public abstract void viewChange(View new_view)
public abstract void suspect(Address mbr)
public abstract void siteUnreachable(String site)
public abstract void transportClosed()
public boolean isMet()
Condition
protected abstract boolean responsesComplete()
public boolean getResponsesComplete()
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future
protected void checkCompletion(Future future)
protected boolean responsesComplete(long timeout) throws InterruptedException
execute()
).InterruptedException
protected boolean waitForResults(long timeout)
Copyright © 2021 JBoss, a division of Red Hat. All rights reserved.