KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portlet > forums > commands > CompositeCommand


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under GPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portlet.forums.commands;
12
13 import java.util.Iterator JavaDoc;
14 import java.util.LinkedList JavaDoc;
15
16 import org.jboss.portal.common.command.Command;
17 import org.jboss.portal.common.command.Configurator;
18 import org.jboss.portal.common.command.EmptyConfigurator;
19 import org.jboss.portal.common.command.result.Result;
20
21 /**
22  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
23  * @version $Revision: 1.2 $
24  */

25 public class CompositeCommand
26    implements Command
27 {
28    private final LinkedList JavaDoc list = new LinkedList JavaDoc();
29
30    /**
31     * DOCUMENT_ME
32     *
33     * @param cmd DOCUMENT_ME
34     */

35    public void add(Command cmd)
36    {
37       list.add(cmd);
38    }
39
40    /**
41     * DOCUMENT_ME
42     *
43     * @return DOCUMENT_ME
44     */

45    public Configurator getConfigurator()
46    {
47       return EmptyConfigurator.EMPTY_CONFIGURATOR;
48    }
49
50    /**
51     * DOCUMENT_ME
52     *
53     * @return DOCUMENT_ME
54     */

55    public Iterator JavaDoc iterator()
56    {
57       return list.iterator();
58    }
59
60    /**
61     * DOCUMENT_ME
62     *
63     * @return DOCUMENT_ME
64     */

65    public Result execute()
66    {
67       throw new RuntimeException JavaDoc("Cannot be executed directly");
68    }
69 }
Popular Tags