public abstract class Request extends java.lang.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 java.util.concurrent.locks.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(java.util.concurrent.Future future) |
protected void |
corrDone() |
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(java.lang.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(java.lang.String site) |
abstract void |
suspect(Address mbr) |
java.lang.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 java.util.concurrent.locks.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)
NotifyingFuturesetListener in interface NotifyingFuturelistener - listener to attachpublic boolean execute(Message req, boolean block_for_results) throws java.lang.Exception
java.lang.Exceptionprotected abstract void sendRequest(Message request_msg) throws java.lang.Exception
java.lang.Exceptionpublic abstract void receiveResponse(java.lang.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(java.lang.String site)
public abstract void transportClosed()
public boolean isMet()
Conditionprotected abstract boolean responsesComplete()
public boolean getResponsesComplete()
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Futurepublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Futurepublic boolean isDone()
isDone in interface java.util.concurrent.Futurepublic java.lang.String toString()
toString in class java.lang.Objectprotected void checkCompletion(java.util.concurrent.Future future)
protected boolean responsesComplete(long timeout)
throws java.lang.InterruptedException
execute()).java.lang.InterruptedExceptionprotected boolean waitForResults(long timeout)
protected void corrDone()
Copyright © 1998-2020 Red Hat. All Rights Reserved.