Class PassthroughSingleResponseCollector
- java.lang.Object
-
- org.infinispan.remoting.transport.impl.PassthroughSingleResponseCollector
-
- All Implemented Interfaces:
ResponseCollector<Response>
public class PassthroughSingleResponseCollector extends Object implements ResponseCollector<Response>
RPC to a single node, without any validity checks.- Since:
- 9.1
- Author:
- Dan Berindei
-
-
Field Summary
Fields Modifier and Type Field Description static PassthroughSingleResponseCollectorINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseaddResponse(Address sender, Response response)Called when a response is received, or when a target node becomes unavailable.Responsefinish()Called afterResponseCollector.addResponse(Address, Response)returnsnullfor the last response.
-
-
-
Field Detail
-
INSTANCE
public static final PassthroughSingleResponseCollector INSTANCE
-
-
Method Detail
-
addResponse
public Response addResponse(Address sender, Response response)
Description copied from interface:ResponseCollectorCalled when a response is received, or when a target node becomes unavailable.When a target node leaves the cluster, this method is called with a
CacheNotFoundResponse.Should return a non-
nullresult if the request should complete with that value, ornullif it should wait for more responses. If the method throws an exception, the request will be completed with that exception. If the last response is received andaddResponse()still returnsnull,ResponseCollector.finish()will also be called to obtain a result.Thread safety:
addResponse()will *not* be called concurrently from multiple threads, and the request will not be completed whileaddResponse()is running.- Specified by:
addResponsein interfaceResponseCollector<Response>
-
finish
public Response finish()
Description copied from interface:ResponseCollectorCalled afterResponseCollector.addResponse(Address, Response)returnsnullfor the last response.If
finish()finishes normally, the request will complete with its return value (even ifnull). Iffinish()throws an exception, the request will complete exceptionally with that exception, wrapped in aCompletionException(unless the exception is already aCompletionException).- Specified by:
finishin interfaceResponseCollector<Response>
-
-