KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > multiplexer > PullPushMultiplexer


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact : dream@objectweb.org
20  *
21  * Initial developer(s): Vivien Quema
22  * Contributor(s):
23  */

24
25 package org.objectweb.dream.multiplexer;
26
27 import java.util.ArrayList JavaDoc;
28 import java.util.Map JavaDoc;
29
30 import org.objectweb.fractal.api.NoSuchInterfaceException;
31
32 /**
33  * This interface defines a pull-push multiplexer. This multiplexer has two
34  * <i>collection </i> client interfaces:
35  * <ul>
36  * <li>a Pull client collection interface for incoming messages (input).</li>
37  * <li>a Push client collection interface for outgoing messages (output).</li>
38  * </ul>
39  * Inputs can be attached (detached) to (from) outputs using the attach (detach)
40  * method.
41  */

42 public interface PullPushMultiplexer
43 {
44
45   /**
46    * The commonly used name to refer to this interface.
47    */

48   String JavaDoc ITF_NAME = "multiplexer";
49
50   /**
51    * Attaches a set of inputs to a set of outputs.
52    *
53    * @param inputNames the names of the inputs to be attached. These inputs must
54    * have been previously bound (with the same name) using the
55    * <code>BindingController</code> interface.
56    * @param inputContexts the contexts to be passed when pulling the inputs.
57    * @param outputNames the names of the outputs to wich intputs must be
58    * attached. These outputs must have been previously bound (with the
59    * same name) using the <code>BindingController</code> interface.
60    * @param outputContexts the contexts to be passed when pushing the outputs.
61    * @param parameters the attachement parameters.
62    * @return an <code>Attachment</code> object
63    * @throws NoSuchInterfaceException if inputNames or outputNames contains the
64    * name of an interface to which the component has not been bound.
65    */

66   Attachment attach(String JavaDoc[] inputNames, Map JavaDoc[] inputContexts,
67       String JavaDoc[] outputNames, Map JavaDoc[] outputContexts, Map JavaDoc parameters)
68       throws NoSuchInterfaceException;
69
70   /**
71    * Detaches a set of inputs from a set of outputs.
72    *
73    * @param attachment an attachment returned by <code>attach</code>
74    */

75   void detach(Attachment attachment);
76
77   /**
78    * Updates an attachement. New parameters are given in an
79    * <code>Attachment</code>.
80    *
81    * @param attachment an attachment returned by <code>attach</code>.
82    */

83   void update(Attachment attachment);
84
85   /**
86    * Returns the attachments that have been registered.
87    *
88    * @return the attachments that have been registered.
89    */

90   ArrayList JavaDoc getAttachments();
91 }
Popular Tags