01: /**
02: *
03: */package org.drools.scm;
04:
05: import java.util.ArrayList;
06: import java.util.Collections;
07: import java.util.Iterator;
08: import java.util.List;
09:
10: import org.tmatesoft.svn.core.SVNException;
11: import org.tmatesoft.svn.core.io.ISVNEditor;
12:
13: public class CompositeScmAction implements ScmAction {
14: private List actions;
15:
16: public CompositeScmAction() {
17: this .actions = Collections.EMPTY_LIST;
18: }
19:
20: public void addScmAction(ScmAction action) {
21: if (actions == Collections.EMPTY_LIST) {
22: this .actions = new ArrayList();
23: }
24: this .actions.add(action);
25: }
26:
27: public void applyAction(Object context) throws Exception {
28: for (Iterator it = this .actions.iterator(); it.hasNext();) {
29: ScmAction action = (ScmAction) it.next();
30: action.applyAction(context);
31: }
32: }
33: }
|