Package org.jgroups.blocks
Class UnicastRequest<T>
java.lang.Object
org.jgroups.blocks.Request
org.jgroups.blocks.UnicastRequest<T>
- All Implemented Interfaces:
Future,RspCollector,Command,NotifyingFuture
Sends a request to a single target destination
- Author:
- Bela Ban
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsFields inherited from class org.jgroups.blocks.Request
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 Summary
ConstructorsConstructorDescriptionUnicastRequest(Message m, RequestCorrelator corr, Address target, RequestOptions options) UnicastRequest(Message m, Transport transport, Address target, RequestOptions options) -
Method Summary
Modifier and TypeMethodDescriptionget()voidreceiveResponse(Object response_value, Address sender) Callback (called by RequestCorrelator or Transport).protected booleanprotected voidvoidCallback (called by RequestCorrelator or Transport).toString()voidviewChange(View new_view) If the target address is not a member of the new view, we'll mark the response as not received and unblock the caller of execute()Methods inherited from class org.jgroups.blocks.Request
cancel, checkCompletion, execute, getBlockForResults, getRequestId, getResponsesComplete, isCancelled, isDone, modeToString, responsesComplete, setBlockForResults, setListener, setResponseFilter, waitForResultsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
result
-
target
-
-
Constructor Details
-
UnicastRequest
- Parameters:
timeout- Time to wait for responses (ms). A value of invalid input: '<'= 0 means wait indefinitely (e.g. if a suspicion service is available; timeouts are not needed).
-
UnicastRequest
- Parameters:
timeout- Time to wait for responses (ms). A value of invalid input: '<'= 0 means wait indefinitely (e.g. if a suspicion service is available; timeouts are not needed).
-
-
Method Details
-
sendRequest
- Specified by:
sendRequestin classRequest- Throws:
Exception
-
receiveResponse
Callback (called by RequestCorrelator or Transport). Adds a response to the response table. When all responses have been received,execute()returns.- Specified by:
receiveResponsein interfaceRspCollector- Specified by:
receiveResponsein classRequest
-
suspect
Callback (called by RequestCorrelator or Transport). Report toGroupRequestthat 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.- Specified by:
suspectin interfaceRspCollector- Specified by:
suspectin classRequest
-
viewChange
If the target address is not a member of the new view, we'll mark the response as not received and unblock the caller of execute()- Specified by:
viewChangein interfaceRspCollector- Specified by:
viewChangein classRequest
-
getResult
-
get
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException -
toString
-
responsesComplete
protected boolean responsesComplete()- Specified by:
responsesCompletein classRequest
-