KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > api > control > ContentController


1 /***
2  * Fractal API
3  * Copyright (C) 2001-2002 France Telecom, INRIA
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: fractal@objectweb.org
20  *
21  * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet,
22  * Philippe Merle, Jean-Bernard Stefani.
23  */

24
25 package org.objectweb.fractal.api.control;
26
27 import org.objectweb.fractal.api.Component;
28 import org.objectweb.fractal.api.NoSuchInterfaceException;
29
30 /**
31  * A component interface to control the content of the component to which it
32  * belongs. This content is supposed to be made of an unordered, unstructured
33  * set of components.
34  */

35
36 public interface ContentController {
37
38   /**
39    * Returns the internal interfaces of the component to which this interface
40    * belongs.
41    *
42    * @return the internal interfaces of the component to which this interface
43    * belongs.
44    */

45
46   Object JavaDoc[] getFcInternalInterfaces ();
47
48   /**
49    * Returns an internal interface of the component to which this interface
50    * belongs.
51    *
52    * @param interfaceName the name of the internal interface that must be
53    * returned.
54    * @return the internal interface of the component to which this interface
55    * belongs, whose name is equal to the given name.
56    * @throws NoSuchInterfaceException if there is no such interface.
57    */

58
59   Object JavaDoc getFcInternalInterface (String JavaDoc interfaceName)
60     throws NoSuchInterfaceException;
61
62   /**
63    * Returns the sub-components of this component.
64    *
65    * @return the {@link Component} interfaces of the sub-components of the
66    * component to which this interface belongs.
67    */

68
69   Component[] getFcSubComponents ();
70
71   /**
72    * Adds a sub-component to this component. More precisely adds the component
73    * whose reference is given as a sub-component of the component to which this
74    * interface belongs. If <i>C</i> is the sub-component set returned by {@link
75    * #getFcSubComponents getFcSubComponents} just before a call to this
76    * method, and <i>C'</i> is the sub-component set just after this call, then
77    * <tt>subComponent</tt> is guaranteed to be in <i>C'</i>, but <i>C'</i> is
78    * <i>not</i> guaranted to be the union of <i>C</i> and <i>{subComponent}</i>,
79    * nor to contain all the elements of <i>C</i>.
80    *
81    * @param subComponent the component to be added inside this component.
82    * @throws IllegalContentException if the given component cannot be added
83    * inside this component.
84    * @throws IllegalLifeCycleException if this component has a {@link
85    * LifeCycleController} interface, but it is not in an appropriate state
86    * to perform this operation.
87    */

88
89   void addFcSubComponent (Component subComponent)
90     throws IllegalContentException, IllegalLifeCycleException;
91
92   /**
93    * Removes a sub-component from this component. More precisely removes the
94    * sub-component whose reference is given from the component to which this
95    * interface belongs. If <i>C</i> is the sub-component set returned by {@link
96    * #getFcSubComponents getFcSubComponents} just before a call to this
97    * method, and <i>C'</i> is the sub-component set just after this call, then
98    * <tt>subComponent</tt> is guaranteed not to be in <i>C'</i>, but <i>C'</i>
99    * is <i>not</i> guaranted to be the difference of <i>C</i> and
100    * <i>{subComponent}</i>, nor to contain all the elements of <i>C</i> distinct
101    * from <tt>subComponent</tt>.
102    *
103    * @param subComponent the component to be removed from this component.
104    * @throws IllegalContentException if the given component cannot be removed
105    * from this component.
106    * @throws IllegalLifeCycleException if this component has a {@link
107    * LifeCycleController} interface, but it is not in an appropriate state
108    * to perform this operation.
109    */

110
111   void removeFcSubComponent (Component subComponent)
112     throws IllegalContentException, IllegalLifeCycleException;
113 }
114
Popular Tags