public class MultiRequest extends Request
Modifier and Type | Field and Description |
---|---|
protected int |
expected_mbrs |
block_for_results, completed, corr, done, GET_ABS_MAJORITY, GET_ALL, GET_FIRST, GET_MAJORITY, GET_N, GET_NONE, listener, lock, log, options, req_id, REQUEST_ID, request_msg, transport
Constructor and Description |
---|
MultiRequest(Message m,
RequestCorrelator corr,
Address target,
RequestOptions options,
int expected_mbrs) |
MultiRequest(Message m,
RequestCorrelator corr,
Collection<Address> mbrs,
RequestOptions options,
int expected_mbrs) |
MultiRequest(Message m,
Transport transport,
Collection<Address> mbrs,
RequestOptions options,
int expected_mbrs) |
Modifier and Type | Method and Description |
---|---|
RspList |
get() |
RspList |
get(long timeout,
TimeUnit unit) |
boolean |
getAnycasting() |
RspList |
getResults()
Returns the results as a RspList
|
void |
receiveResponse(Object response_value,
Address sender)
Callback (called by RequestCorrelator or Transport).
|
protected boolean |
responsesComplete() |
void |
sendRequest() |
void |
setAnycasting(boolean anycasting) |
void |
suspect(Address suspected_member)
Callback (called by RequestCorrelator or Transport).
|
String |
toString() |
void |
viewChange(View new_view)
Any member of 'membership' that is not in the new view is flagged as
SUSPECTED.
|
cancel, checkCompletion, execute, getBlockForResults, getRequestId, getResponsesComplete, isCancelled, isDone, modeToString, responsesComplete, setBlockForResults, setListener, setResponseFilter, waitForResults
public MultiRequest(Message m, RequestCorrelator corr, Collection<Address> mbrs, RequestOptions options, int expected_mbrs)
m
- The message to be sentcorr
- The request correlator to be used. A request correlator
sends requests tagged with a unique ID and notifies the
sender when matching responses are received. The reason
GroupRequest
uses it instead of a
Transport
is that multiple
requests/responses might be sent/received concurrently.mbrs
- The initial membership. This value reflects the membership
to which the request is sent (and from which potential
responses are expected). Is reset by reset().options
- The options to be passed to the requestpublic MultiRequest(Message m, RequestCorrelator corr, Address target, RequestOptions options, int expected_mbrs)
public MultiRequest(Message m, Transport transport, Collection<Address> mbrs, RequestOptions options, int expected_mbrs)
timeout
- Time to wait for responses (ms). A value of <= 0 means wait indefinitely
(e.g. if a suspicion service is available; timeouts are not needed).public boolean getAnycasting()
public void setAnycasting(boolean anycasting)
public void sendRequest() throws Exception
sendRequest
in class Request
Exception
public void receiveResponse(Object response_value, Address sender)
execute()
returns.receiveResponse
in interface RspCollector
receiveResponse
in class Request
public void suspect(Address suspected_member)
GroupRequest
that a member is reported as faulty (suspected).
This method would probably be called when getting a suspect message from a failure detector
(where available). It is used to exclude faulty members from the response list.suspect
in interface RspCollector
suspect
in class Request
public void viewChange(View new_view)
viewChange
in interface RspCollector
viewChange
in class Request
public RspList getResults()
public RspList get() throws InterruptedException, ExecutionException
public RspList get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
protected boolean responsesComplete()
responsesComplete
in class Request
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.