KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > corba > generator > cif_idl > lib > ProxyHomeMapping


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

26
27 package org.objectweb.corba.generator.cif_idl.lib;
28
29 // Package dependencies.
30
import org.objectweb.openccm.ast.api.ProxyHomeDecl;
31 import org.objectweb.openccm.ast.api.ModuleDecl;
32 import org.objectweb.openccm.ast.api.InterfaceDecl;
33 import org.objectweb.openccm.ast.utils.api.CompositionInfo;
34
35 /**
36  * This class generates CIF IDL for an OMG CIDL Proxy Home.
37  *
38  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
39  *
40  * @version 0.1
41  */

42
43 public class ProxyHomeMapping
44   implements org.objectweb.corba.generator.cif_idl.api.ProxyHomeMapping
45 {
46     // ==================================================================
47
//
48
// Internal state.
49
//
50
// ==================================================================
51

52     /** The proxy home to map. */
53     private ProxyHomeDecl proxy_home_;
54
55     // ==================================================================
56
//
57
// Constructors.
58
//
59
// ==================================================================
60

61     /**
62      * The default constructor.
63      *
64      * @param proxy_home - The proxy home to map.
65      */

66     public ProxyHomeMapping(ProxyHomeDecl proxy_home)
67     {
68         // Init internal states
69
proxy_home_ = proxy_home;
70     }
71
72     // ==================================================================
73
//
74
// Internal methods.
75
//
76
// ==================================================================
77

78     // ==================================================================
79
//
80
// Public methods for org.objectweb.openccm.generator.cif_idl.api.ProxyHomeMapping
81
//
82
// ==================================================================
83

84     /**
85      * Declare CIF interfaces into Interface Repository.
86      *
87      * @param module - The module to declare CIF mapping in.
88      * @param comp - An abstract view of the binding composition.
89      * @param he_mapping - The home executor CIF mapping interface.
90      */

91     public void
92     declareCIF( ModuleDecl module,
93                 CompositionInfo comp,
94                 InterfaceDecl he_mapping)
95     {
96         org.objectweb.openccm.ast.api.InterfaceList list = null;
97         org.objectweb.openccm.ast.api.OperationDecl op = null;
98         org.objectweb.openccm.ast.api.InterfaceDecl itf = null;
99
100         /** Create the CIF proxy home interface **/
101         itf = module.declareLocalInterface("CIF_" + proxy_home_.getName());
102           // Feed inherited interface list
103
list = itf.getInheritedInterfaceList();
104         list.add(he_mapping);
105         itf.create();
106
107         /** Add the get_home operation **/
108         op = itf.startOperation("get_home");
109         op.setType(he_mapping);
110         op.create();
111    }
112
113     // ==================================================================
114
//
115
// Public methods.
116
//
117
// ==================================================================
118

119 }
120
Popular Tags