KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > kilim > model > ComponentInterface


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

18
19 package org.objectweb.kilim.model;
20
21 import org.objectweb.kilim.KilimException;
22
23 /**
24  * @author horn
25  * A ComponentInterface is a runtime descriptor of an interface.
26  * This class provides therefore several methods to determine the real nature of the interface (unary port, nary port, provider or property).
27  * It supports morover several methods to bind or unbind the interface to values or value sources.
28  */

29     
30 public interface ComponentInterface extends ComponentSource {
31     /**
32      * Method isSingleValueInterface returns true if the interface is a single value port. It returns flase otherwise.
33      * @return boolean
34      */

35     boolean isSingleValuePort();
36     
37     /**
38      * returns true if the interface is a collection port. It returns false otherwise.
39      * @return boolean
40      */

41     boolean isCollectionPort();
42     
43     /**
44      * returns true if the interface is a property. It returns false otherwise.
45      * @return boolean
46      */

47     boolean isProperty();
48     
49     /**
50      * returns true if the interface is a provider (i.e. an unbuffered value source).
51      * @return boolean
52      */

53     boolean isProvider();
54     
55     /**
56      * binds an interface to a value source. This method has a behaviour which depends on the exact kind
57      * @param aProvider : the value source.
58      * @param jReplace : bindProvider applied to a single value port having already a provider generates a warning if jReplace is false.
59      * It silently replaces the existing value if jReplace is true.
60      * @throws KilimException : generated if aProvider is null.
61      */

62     void bindProvider(RuntimeSource aProvider, boolean jReplace) throws KilimException;
63     
64     /**
65      * unbinds an interface and source value.
66      * @param aProvider : the source value to be unbound.
67      * @throws KilimException : generated if aProvider is null or is not bound to the interface.
68      */

69     void unbindProvider(RuntimeSource aProvider) throws KilimException;
70
71     /**
72      * Method isModified.
73      * @return boolean
74      * @throws KilimException :
75      */

76     boolean isModified() throws KilimException;
77         
78     /**
79      * assigns a value to an interface. If a value has already been associated to the interface,
80      * "unbind" triggers are executed prior to the new value assignment. Bind triggers are then executed.
81      * @param aValue : the value to be assigned to the interface.
82      * @throws KilimException : generated when applied to a provider
83      */

84     void bindValue(Object JavaDoc aValue) throws KilimException;
85     
86     /**
87      * sets the value of an interface to null. Unbind triggers are executed (using the value stored in the interface prior to the unbind operation).
88      * @throws KilimException :
89      */

90     void unbindValue() throws KilimException;
91     
92     /**
93      * reexecutes all triggers associated to the interface.
94      * @throws KilimException :
95      */

96     void update() throws KilimException;
97 }
Popular Tags