KickJava   Java API By Example, From Geeks To Geeks.

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


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.NoSuchInterfaceException;
28
29 /**
30  * A component interface to control the bindings of the component to which it
31  * belongs. It is implicitely assumed here that the component's type system
32  * makes a distinction between "client" and "server" interfaces.
33  */

34
35 public interface BindingController {
36
37   /**
38    * Returns the names of the client interfaces of the component to which this
39    * interface belongs.
40    *
41    * @return the names of the client interfaces of the component to which this
42    * interface belongs.
43    */

44
45   String JavaDoc[] listFc ();
46
47   /**
48    * Returns the interface to which the given client interface is bound. More
49    * precisely, returns the server interface to which the client interface whose
50    * name is given is bound. This server interface is necessarily in the same
51    * address space as the client interface (see {@link #bindFc bindFc}).
52    *
53    * @param clientItfName the name of a client interface of the component to
54    * which this interface belongs.
55    * @return the server interface to which the given interface is bound, or <tt>
56    * null</tt> if it is not bound.
57    * @throws NoSuchInterfaceException if the component to which this interface
58    * belongs does not have a client interface whose name is equal to the
59    * given name.
60    */

61
62   Object JavaDoc lookupFc (String JavaDoc clientItfName) throws NoSuchInterfaceException;
63
64   /**
65    * Binds the client interface whose name is given to a server interface. More
66    * precisely, binds the client interface of the component to which this
67    * interface belongs, and whose name is equal to the given name, to the given
68    * server interface. The given server interface must be in the same address
69    * space as the client interface.
70    *
71    * @param clientItfName the name of a client interface of the component to
72    * which this interface belongs.
73    * @param serverItf a server interface.
74    * @throws NoSuchInterfaceException if there is no such client interface.
75    * @throws IllegalBindingException if the binding cannot be created.
76    * @throws IllegalLifeCycleException if this component has a {@link
77    * LifeCycleController} interface, but it is not in an appropriate state
78    * to perform this operation.
79    */

80
81   void bindFc (String JavaDoc clientItfName, Object JavaDoc serverItf) throws
82     NoSuchInterfaceException,
83     IllegalBindingException,
84     IllegalLifeCycleException;
85
86   /**
87    * Unbinds the given client interface. More precisely, unbinds the client
88    * interface of the component to which this interface belongs, and whose name
89    * is equal to the given name.
90    *
91    * @param clientItfName the name of a client interface of the component to
92    * which this interface belongs.
93    * @throws NoSuchInterfaceException if there is no such client interface.
94    * @throws IllegalBindingException if the binding cannot be removed.
95    * @throws IllegalLifeCycleException if this component has a {@link
96    * LifeCycleController} interface, but it is not in an appropriate state
97    * to perform this operation.
98    */

99
100   void unbindFc (String JavaDoc clientItfName) throws
101     NoSuchInterfaceException,
102     IllegalBindingException,
103     IllegalLifeCycleException;
104 }
105
Popular Tags