@Override /** * Used to construct a Job of empty lists at the appropriate depth in the * event of a completion hitting the crystalizer before it sees a child * node, i.e. the result of iterating over an empty collection structure of * some kind. */ public Job getEmptyJob(String owningProcess, int[] index, InvocationContext context) { int wrappingDepth = parent.resultWrappingDepth; if (wrappingDepth < 0) throw new RuntimeException( "Processor ["+owningProcess+"] hasn't been configured, cannot emit empty job"); // The wrapping depth is the length of index array that would be used if // a single item of the output port type were returned. We can examine // the index array for the node we're trying to create and use this to // work out how much we need to add to the output port depth to create // empty lists of the right type given the index array. int depth = wrappingDepth - index.length; // TODO - why was this incrementing? // depth++; ReferenceService rs = context.getReferenceService(); Map<String, T2Reference> emptyJobMap = new HashMap<String, T2Reference>(); for (OutputPort op : parent.getOutputPorts()) { emptyJobMap.put(op.getName(), rs.getListService() .registerEmptyList(depth + op.getDepth()).getId()); } return new Job(owningProcess, index, emptyJobMap, context); }
@Override /** * Used to construct a Job of empty lists at the appropriate depth in the * event of a completion hitting the crystalizer before it sees a child * node, i.e. the result of iterating over an empty collection structure of * some kind. */ public Job getEmptyJob(String owningProcess, int[] index, InvocationContext context) { int wrappingDepth = parent.resultWrappingDepth; if (wrappingDepth < 0) throw new RuntimeException( "Processor ["+owningProcess+"] hasn't been configured, cannot emit empty job"); // The wrapping depth is the length of index array that would be used if // a single item of the output port type were returned. We can examine // the index array for the node we're trying to create and use this to // work out how much we need to add to the output port depth to create // empty lists of the right type given the index array. int depth = wrappingDepth - index.length; // TODO - why was this incrementing? // depth++; ReferenceService rs = context.getReferenceService(); Map<String, T2Reference> emptyJobMap = new HashMap<String, T2Reference>(); for (OutputPort op : parent.getOutputPorts()) { emptyJobMap.put(op.getName(), rs.getListService() .registerEmptyList(depth + op.getDepth(), context).getId()); } return new Job(owningProcess, index, emptyJobMap, context); }
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth, context); return newList.getId(); } catch (ListServiceException lse) {
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth); return newList.getId(); } catch (ListServiceException lse) {
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth, context); return newList.getId(); } catch (ListServiceException lse) {
int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth).getId());
int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth, jobEvent.getContext()).getId());