@Experimental public abstract class MapResponseCollector extends ValidResponseCollector<Map<Address,Response>>
JGroupsTransport.invokeRemotelyAsync(Collection, ReplicableCommand, ResponseMode, long, ResponseFilter, DeliverOrder, boolean)
.Modifier and Type | Field and Description |
---|---|
protected HashMap<Address,Response> |
map |
Modifier and Type | Method and Description |
---|---|
protected Map<Address,Response> |
addException(Address sender,
Exception exception)
Process an exception from a target.
|
protected Map<Address,Response> |
addValidResponse(Address sender,
ValidResponse response)
Process a valid response from a target.
|
Map<Address,Response> |
finish()
Called after
ResponseCollector.addResponse(Address, Response) returns null for the last response. |
static MapResponseCollector |
ignoreLeavers() |
static MapResponseCollector |
ignoreLeavers(boolean ignoreLeavers) |
static MapResponseCollector |
ignoreLeavers(boolean ignoreLeavers,
int expectedSize) |
static MapResponseCollector |
ignoreLeavers(int expectedSize) |
protected void |
recordException(Exception e) |
static MapResponseCollector |
validOnly() |
static MapResponseCollector |
validOnly(int expectedSize) |
addResponse, addTargetNotFound
public static MapResponseCollector validOnly(int expectedSize)
public static MapResponseCollector validOnly()
public static MapResponseCollector ignoreLeavers(int expectedSize)
public static MapResponseCollector ignoreLeavers()
public static MapResponseCollector ignoreLeavers(boolean ignoreLeavers, int expectedSize)
public static MapResponseCollector ignoreLeavers(boolean ignoreLeavers)
protected Map<Address,Response> addException(Address sender, Exception exception)
ValidResponseCollector
addException
in class ValidResponseCollector<Map<Address,Response>>
null
to continue waiting for responses (the default), non-null
to complete with that
value.protected void recordException(Exception e)
protected Map<Address,Response> addValidResponse(Address sender, ValidResponse response)
ValidResponseCollector
addValidResponse
in class ValidResponseCollector<Map<Address,Response>>
null
to continue waiting for response, non-null
to complete with that value.public Map<Address,Response> finish()
ResponseCollector
ResponseCollector.addResponse(Address, Response)
returns null
for the last response.
If finish()
finishes normally, the request will complete with its return value
(even if null
).
If finish()
throws an exception, the request will complete exceptionally with that exception,
wrapped in a CompletionException
(unless the exception is already a
CompletionException
).
finish
in interface ResponseCollector<Map<Address,Response>>
finish
in class ValidResponseCollector<Map<Address,Response>>
Copyright © 2021 JBoss by Red Hat. All rights reserved.