Ejemplo n.º 1
0
 private boolean collect(
     FlowGraph graph,
     List<Tuple2<InputDescription, ExternalIoDescriptionProcessor>> inputs,
     List<Tuple2<OutputDescription, ExternalIoDescriptionProcessor>> outputs) {
   assert graph != null;
   assert inputs != null;
   assert outputs != null;
   boolean valid = true;
   Repository externals = environment.getExternals();
   for (FlowIn<?> port : graph.getFlowInputs()) {
     InputDescription desc = port.getDescription();
     ExternalIoDescriptionProcessor processor = externals.findProcessor(desc);
     if (processor != null) {
       inputs.add(Tuples.of(desc, processor));
     } else {
       environment.error("{0}を処理するプロセッサが見つかりませんでした。", desc.getClass().getName());
       valid = false;
     }
   }
   for (FlowOut<?> port : graph.getFlowOutputs()) {
     OutputDescription desc = port.getDescription();
     ExternalIoDescriptionProcessor processor = externals.findProcessor(desc);
     if (processor != null) {
       outputs.add(Tuples.of(desc, processor));
     } else {
       valid = false;
     }
   }
   return valid;
 }
Ejemplo n.º 2
0
 private <T> void normalize(
     List<Tuple2<T, ExternalIoDescriptionProcessor>> list,
     Map<Class<?>, ExternalIoDescriptionProcessor> actives) {
   assert list != null;
   assert actives != null;
   for (ListIterator<Tuple2<T, ExternalIoDescriptionProcessor>> iter = list.listIterator();
       iter.hasNext(); ) {
     Tuple2<T, ExternalIoDescriptionProcessor> tuple = iter.next();
     ExternalIoDescriptionProcessor normal = actives.get(tuple._2.getClass());
     iter.set(Tuples.of(tuple._1, normal));
   }
 }