KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > common > command > CompositeCommand


1 /***************************************
2  * *
3  * Nukes: The OpenSource CMS *
4  * *
5  * Distributable under GPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9
10 package org.jboss.portal.common.command;
11
12 import java.util.Iterator JavaDoc;
13 import java.util.LinkedList JavaDoc;
14
15 import org.jboss.portal.common.command.result.Result;
16
17 /**
18  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
19  * @version $Revision: 1.2 $
20  */

21 public class CompositeCommand
22    implements Command
23 {
24
25    private final LinkedList JavaDoc list = new LinkedList JavaDoc();
26
27    public void add(Command cmd)
28    {
29       list.add(cmd);
30    }
31
32    public Configurator getConfigurator()
33    {
34       return EmptyConfigurator.EMPTY_CONFIGURATOR;
35    }
36
37    public Iterator JavaDoc iterator()
38    {
39       return list.iterator();
40    }
41
42    public Result execute()
43    {
44       throw new RuntimeException JavaDoc("Cannot be executed directly");
45    }
46 }
47
Popular Tags