Class AutoStateTransferResponseCollector
- java.lang.Object
-
- org.infinispan.xsite.response.AutoStateTransferResponseCollector
-
- All Implemented Interfaces:
ResponseCollector<AutoStateTransferResponse>
public class AutoStateTransferResponseCollector extends Object implements ResponseCollector<AutoStateTransferResponse>
AResponseCollector
that mergesAutoStateTransferResponse
.- Since:
- 12.1
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description AutoStateTransferResponseCollector(boolean isOffline, XSiteStateTransferMode stateTransferMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoStateTransferResponse
addResponse(Address sender, Response response)
Called when a response is received, or when a target node becomes unavailable.AutoStateTransferResponse
finish()
Called afterResponseCollector.addResponse(Address, Response)
returnsnull
for the last response.void
merge(AutoStateTransferResponse response)
-
-
-
Constructor Detail
-
AutoStateTransferResponseCollector
public AutoStateTransferResponseCollector(boolean isOffline, XSiteStateTransferMode stateTransferMode)
-
-
Method Detail
-
finish
public AutoStateTransferResponse finish()
Description copied from interface:ResponseCollector
Called afterResponseCollector.addResponse(Address, Response)
returnsnull
for 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:
finish
in interfaceResponseCollector<AutoStateTransferResponse>
-
addResponse
public final AutoStateTransferResponse addResponse(Address sender, Response response)
Description copied from interface:ResponseCollector
Called 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-
null
result if the request should complete with that value, ornull
if 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:
addResponse
in interfaceResponseCollector<AutoStateTransferResponse>
-
merge
public void merge(AutoStateTransferResponse response)
-
-