compositeactivity.java
来自「一个很好的微工作流内核」· Java 代码 · 共 50 行
JAVA
50 行
/* * * Copyright (c) 2002, 2003 Dragos Manolescu (dam@micro-workflow.com) * * See the LICENSE file for licensing information. */package com.microworkflow.process;import java.util.ArrayList;import java.util.Iterator;import java.util.List;import com.microworkflow.execution.Continuation;public abstract class CompositeActivity extends Activity { protected ArrayList components = new ArrayList(); /** * Delay generating the set of continuations for a CompositeActivity. * This will prevent StackOverflowError with loops in the Workflow. * * @author Ringo De Smet */ class DelayedContinuationIterator implements Iterator { protected Continuation parent; protected Iterator componentsIterator; public DelayedContinuationIterator(Continuation parent,List components) { this.parent = parent; this.componentsIterator = components.iterator(); } public boolean hasNext() { return this.componentsIterator.hasNext(); } public Object next() { return ((Activity) this.componentsIterator.next()).continuationWith(this.parent); } public void remove() { // do nothing. } } protected Iterator getContinuationsForComponentsWith(Continuation parent) { return new DelayedContinuationIterator(parent, this.components); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?