|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResponseFilter
Interface defining when a group request is done, allowing early termination
of a group request based on logic implemented by the caller. For example,
an RPC could be invoked on all members of a group, but as soon as a single
valid response is received the needMoreResponses()
method could
return false
allowing the call to return without waiting for
other slower-to-arrive responses.
Based on JGroups' RspFilter concept, but with a separate abstraction.
The abstraction has be done to avoid leaking JGroups classes to
ha-server-api consumers and to avoid adding an absolute dependency on JGroups
to HAPartition implementations.
HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean, ResponseFilter)
Method Summary | |
---|---|
boolean |
isAcceptable(Object response,
ClusterNode sender)
Determines whether a response from a given sender should be added to the response list of the request |
boolean |
needMoreResponses()
Right after a call to isAcceptable(Object, ClusterNode) , this
method is called to see whether we are done with the request and can
unblock the caller. |
Method Detail |
---|
boolean isAcceptable(Object response, ClusterNode sender)
response
- The response (usually a serializable value)sender
- The sender of response
true
if we should add the response to the response
list of returned by
HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean, ResponseFilter)
otherwise false. In the latter case, the response will not be included in
the list returned to the RPC caller.boolean needMoreResponses()
isAcceptable(Object, ClusterNode)
, this
method is called to see whether we are done with the request and can
unblock the caller.
true
if the request is done, otherwise false
alse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |