private static final int TRY_COUNT = 100;
@Override
public final void process() throws Exception {
ClientEndpoint endpoint = getEndpoint();
OperationFactory operationFactory = createOperationFactory();
Collection<Address> targets = getTargets();
if (targets.isEmpty()) {
endpoint.sendResponse(reduce(new HashMap<Address, Object>()), getCallId());
return;
}
MultiTargetCallback callback = new MultiTargetCallback(targets);
for (Address target : targets) {
Operation op = operationFactory.createOperation();
op.setCallerUuid(endpoint.getUuid());
InvocationBuilder builder = operationService.createInvocationBuilder(getServiceName(), op, target)
.setTryCount(TRY_COUNT)
.setResultDeserialized(false)
.setCallback(new SingleTargetCallback(target, callback));
builder.invoke();