@Override public void run() { currentRetryCount++; getBelow().receiveJob(jobEvent); } };
DispatchJobEvent newJobEvent = prepareNewJobEvent(data, dispatchEvent); getBelow().receiveJob(newJobEvent); } else if (dispatchEvent instanceof DispatchJobQueueEvent) { getBelow().receiveJobQueue(
@Override public void receiveJob(DispatchJobEvent jobEvent) { DispatchLayer<?> below = dispatchStack.layerBelow(this); if (below != null) below.receiveJob(jobEvent); }
/** * Receive a job from the layer above, store it for later retries and pass * it down to the next layer */ @Override public void receiveJob(DispatchJobEvent jobEvent) { addJobToStateList(jobEvent); getBelow().receiveJob(jobEvent); }
@Override public boolean handleError() { currentActivityIndex++; if (currentActivityIndex == jobEvent.getActivities().size()) return false; List<Activity<?>> newActivityList = new ArrayList<>(); newActivityList.add(jobEvent.getActivities().get( currentActivityIndex)); getBelow().receiveJob( new DispatchJobEvent(jobEvent.getOwningProcess(), jobEvent .getIndex(), jobEvent.getContext(), jobEvent .getData(), newActivityList)); return true; } }
/** * If the job contains errors, or collections which contain errors * themselves then bounce a result message with error documents in back up * to the layer above */ @Override public void receiveJob(DispatchJobEvent jobEvent) { Set<T2Reference> errorReferences = new HashSet<>(); for (T2Reference ei : jobEvent.getData().values()) if (ei.containsErrors()) errorReferences.add(ei); if (errorReferences.isEmpty()) // relay the message down... getBelow().receiveJob(jobEvent); else { getState(jobEvent.getOwningProcess()).incrementErrorsReflected(); sendErrorOutput(jobEvent, null, errorReferences); } }
/** * Receive a job from the layer above, store it in the state map then relay * it to the layer below with a modified activity list containing only the * activity at index 0 */ @Override public void receiveJob(DispatchJobEvent jobEvent) { addJobToStateList(jobEvent); List<Activity<?>> newActivityList = new ArrayList<>(); newActivityList.add(jobEvent.getActivities().get(0)); getBelow().receiveJob( new DispatchJobEvent(jobEvent.getOwningProcess(), jobEvent .getIndex(), jobEvent.getContext(), jobEvent.getData(), newActivityList)); }
new HashSet<MonitorableProperty<?>>()); getBelow().receiveJob(dispatchJobEvent);