/** * Creates a new {@link FlowHead} that points to the same node. */ public FlowHead fork() { FlowHead h = new FlowHead(execution); h.head = this.head; execution.addHead(h); return h; }
@SuppressFBWarnings(value = "IS2_INCONSISTENT_SYNC", justification="Storage does not actually NEED to be synchronized but the rest does.") protected synchronized void initializeStorage() throws IOException { storage = createStorage(); heads = new TreeMap<Integer,FlowHead>(); for (Map.Entry<Integer,String> entry : headsSerial.entrySet()) { FlowHead h = new FlowHead(this, entry.getKey()); FlowNode n = storage.getNode(entry.getValue()); if (n != null) { h.setForDeserialize(storage.getNode(entry.getValue())); heads.put(h.getId(), h); } else { throw new IOException("Tried to load head FlowNodes for execution "+this.owner+" but FlowNode was not found in storage for head id:FlowNodeId "+entry.getKey()+":"+entry.getValue()); } } headsSerial = null; startNodes = new Stack<BlockStartNode>(); for (String id : startNodesSerial) { FlowNode node = storage.getNode(id); if (node != null) { startNodes.add((BlockStartNode) storage.getNode(id)); } else { // TODO if possible, consider trying to close out unterminated blocks using heads, to keep existing graph history throw new IOException( "Tried to load startNode FlowNodes for execution "+this.owner+" but FlowNode was not found in storage for FlowNode Id "+id); } } startNodesSerial = null; }
s.$initialize(); final FlowHead h = new FlowHead(this); synchronized (this) { heads.put(h.getId(), h);
head = new FlowHead(this); try { head.newStartNode(new FlowStartNode(this, iotaStr()));
FlowHead head = new FlowHead(this); this.heads = new TreeMap<Integer, FlowHead>(); heads.put(head.getId(), head);