|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.blocks.Request
public abstract class Request
Abstract class for a unicast or multicast request
Field Summary | |
---|---|
protected boolean |
block_for_results
|
protected java.util.concurrent.locks.Condition |
completed
Is set as soon as the request has received all required responses |
protected RequestCorrelator |
corr
|
protected boolean |
done
|
static int |
GET_ABS_MAJORITY
return majority (of all members, may block) |
static int |
GET_ALL
return all responses |
static int |
GET_FIRST
return only first response |
static int |
GET_MAJORITY
return majority (of all non-faulty members) |
static int |
GET_N
Deprecated. |
static int |
GET_NONE
return no response (async call) |
protected FutureListener |
listener
|
protected java.util.concurrent.locks.Lock |
lock
|
protected static Log |
log
|
protected RequestOptions |
options
|
protected long |
req_id
|
protected static java.util.concurrent.atomic.AtomicLong |
REQUEST_ID
To generate unique request IDs (see getRequestId()) |
protected Message |
request_msg
|
protected Transport |
transport
|
Constructor Summary | |
---|---|
Request(Message request,
RequestCorrelator corr,
Transport transport,
RequestOptions options)
|
|
Request(Message request,
RequestCorrelator corr,
Transport transport,
RspFilter filter,
int mode,
long timeout)
Deprecated. |
Method Summary | |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
protected void |
checkCompletion(java.util.concurrent.Future future)
|
boolean |
execute()
|
boolean |
getBlockForResults()
|
protected static long |
getRequestId()
Generates a new unique request ID |
boolean |
getResponsesComplete()
|
boolean |
isCancelled()
|
boolean |
isDone()
|
static java.lang.String |
modeToString(int m)
|
abstract void |
receiveResponse(java.lang.Object response_value,
Address sender)
|
protected abstract boolean |
responsesComplete()
|
protected boolean |
responsesComplete(long timeout)
This method runs with lock locked (called by execute() ). |
protected abstract void |
sendRequest()
|
void |
setBlockForResults(boolean block_for_results)
|
NotifyingFuture |
setListener(FutureListener listener)
Attaches a listener and returns the same future instance, to allow for 'building' futures. |
void |
setResponseFilter(RspFilter filter)
|
abstract void |
suspect(Address mbr)
|
java.lang.String |
toString()
|
abstract void |
viewChange(View new_view)
|
protected boolean |
waitForResults(long timeout)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.concurrent.Future |
---|
get, get |
Field Detail |
---|
public static final int GET_FIRST
public static final int GET_ALL
public static final int GET_MAJORITY
public static final int GET_ABS_MAJORITY
@Deprecated public static final int GET_N
public static final int GET_NONE
protected static final Log log
protected static final java.util.concurrent.atomic.AtomicLong REQUEST_ID
protected final java.util.concurrent.locks.Lock lock
protected final java.util.concurrent.locks.Condition completed
protected final Message request_msg
protected final RequestCorrelator corr
protected final Transport transport
protected final RequestOptions options
protected volatile boolean done
protected boolean block_for_results
protected final long req_id
protected volatile FutureListener listener
Constructor Detail |
---|
@Deprecated public Request(Message request, RequestCorrelator corr, Transport transport, RspFilter filter, int mode, long timeout)
public Request(Message request, RequestCorrelator corr, Transport transport, RequestOptions options)
Method Detail |
---|
public void setResponseFilter(RspFilter filter)
public boolean getBlockForResults()
public void setBlockForResults(boolean block_for_results)
public NotifyingFuture setListener(FutureListener listener)
NotifyingFuture
setListener
in interface NotifyingFuture
listener
- listener to attach
public boolean execute() throws java.lang.Exception
execute
in interface Command
java.lang.Exception
protected abstract void sendRequest() throws java.lang.Exception
java.lang.Exception
public abstract void receiveResponse(java.lang.Object response_value, Address sender)
receiveResponse
in interface RspCollector
public abstract void viewChange(View new_view)
viewChange
in interface RspCollector
public abstract void suspect(Address mbr)
suspect
in interface RspCollector
protected abstract boolean responsesComplete()
public boolean getResponsesComplete()
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future
public boolean isDone()
isDone
in interface java.util.concurrent.Future
public java.lang.String toString()
toString
in class java.lang.Object
protected void checkCompletion(java.util.concurrent.Future future)
protected static long getRequestId()
protected boolean responsesComplete(long timeout) throws java.lang.InterruptedException
execute()
).
java.lang.InterruptedException
protected boolean waitForResults(long timeout)
public static java.lang.String modeToString(int m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |