/** * We've finished here, set the satisfied property on any controlled * condition objects to true and notify the targets. */ @Override protected void finishedWith(String owningProcess) { if (controlledConditions.isEmpty() == false) { String enclosingProcess = owningProcess.substring(0, owningProcess.lastIndexOf(':')); for (ConditionImpl ci : controlledConditions) { ci.satisfy(enclosingProcess); ci.getTarget().getDispatchStack().satisfyConditions( enclosingProcess); } } }
/** * We've finished here, set the satisfied property on any controlled * condition objects to true and notify the targets. */ @Override protected void finishedWith(String owningProcess) { if (! controlledConditions.isEmpty()) { String enclosingProcess = owningProcess.substring(0, owningProcess.lastIndexOf(':')); for (ConditionImpl ci : controlledConditions) { ci.satisfy(enclosingProcess); ci.getTarget().getDispatchStack().satisfyConditions( enclosingProcess); } } }
/** * We've finished here, set the satisfied property on any controlled * condition objects to true and notify the targets. */ @Override protected void finishedWith(String owningProcess) { if (! controlledConditions.isEmpty()) { String enclosingProcess = owningProcess.substring(0, owningProcess.lastIndexOf(':')); for (ConditionImpl ci : controlledConditions) { ci.satisfy(enclosingProcess); ci.getTarget().getDispatchStack().satisfyConditions( enclosingProcess); } } // Tell whoever is interested that the processor has finished executing processorFinishedMultiCaster.notify(new ProcessorFinishedEvent(this.getProcessor(), owningProcess)); }
public DefaultDispatchStackEdit(Processor processor) { super(processor); DispatchStackImpl stack = ((ProcessorImpl)processor).getDispatchStack(); // Top level parallelise layer int layer = 0; List<Edit<?>> edits = new ArrayList<Edit<?>>(); edits.add(new AddDispatchLayerEdit(stack, new Parallelize(MAX_JOBS), layer++)); edits.add(new AddDispatchLayerEdit(stack, new ErrorBounce(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Failover(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Retry(MAX_RETRIES, INITIAL_DELAY, MAX_DELAY, BACKOFF_FACTOR), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Invoke(), layer++)); compoundEdit=new CompoundEdit(edits); }
public DefaultDispatchStackEdit(Processor processor) { super(processor); DispatchStackImpl stack = ((ProcessorImpl)processor).getDispatchStack(); // Top level parallelise layer int layer = 0; List<Edit<?>> edits = new ArrayList<Edit<?>>(); edits.add(new AddDispatchLayerEdit(stack, new Parallelize(MAX_JOBS), layer++)); edits.add(new AddDispatchLayerEdit(stack, new ErrorBounce(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Failover(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Retry(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Stop(), layer++)); edits.add(new AddDispatchLayerEdit(stack, new Invoke(), layer++)); compoundEdit=new CompoundEdit(edits); }
public void testProcessorAsXMLRoundTrip() throws EditException, ArtifactNotFoundException, ArtifactStateException, ClassNotFoundException, InstantiationException, IllegalAccessException, JDOMException, IOException, ActivityConfigurationException { ProcessorImpl p = (ProcessorImpl)new EditsImpl().createProcessor("a_processor"); DispatchStackImpl stack = p.getDispatchStack(); new AddDispatchLayerEdit(stack, new Parallelize(), 0).doEdit(); new AddDispatchLayerEdit(stack, new Retry(2, 50, 2000, 1), 1).doEdit(); new AddDispatchLayerEdit(stack, new DummyInvokerLayer(), 2).doEdit(); new CreateProcessorInputPortEdit(p, "Input1", 1).doEdit(); new CreateProcessorInputPortEdit(p, "Input2", 0).doEdit(); Element e = p.asXML(); ProcessorImpl p2 = (ProcessorImpl)new EditsImpl().createProcessor("a_processor"); p2.configureFromElement(e); Element e2 = p2.asXML(); XMLOutputter xo = new XMLOutputter(); assertTrue(xo.outputString(e).equals(xo.outputString(e2))); }