KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ast > lib > HomeOperationBaseImpl


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): Philippe Merle.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ast.lib;
28
29 /** Used to access AST DeclarationKind. */
30 import org.objectweb.openccm.ast.api.DeclarationKind;
31
32 /** Used to access AST InterfaceDecl. */
33 import org.objectweb.openccm.ast.api.InterfaceDecl;
34
35 /** Used to access AST OperationDecl. */
36 import org.objectweb.openccm.ast.api.OperationDecl;
37
38 /** Used to access AST HomeDecl. */
39 import org.objectweb.openccm.ast.api.HomeDecl;
40
41 /**
42  * HomeOperationBaseImpl is a wrapper class for
43  * IDL home factory and finder operation declarations.
44  *
45  *
46  * Inherits from:
47  *
48  * - OperationDeclImpl as these are operations,
49  *
50  * - HomeOperationBase: OMG IDL for home factory and finder
51  * operation declarations.
52  *
53  *
54  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
55  *
56  * @version 0.1
57  */

58
59 abstract public class HomeOperationBaseImpl
60          extends OperationDeclImpl
61          implements org.objectweb.openccm.ast.api.HomeOperationBase
62 {
63     // ==================================================================
64
//
65
// Internal state.
66
//
67
// ==================================================================
68

69     /** The client interface operation mapping. */
70     private OperationDecl[] client_mapping_;
71
72     /** The local interface operation mapping. */
73     private OperationDecl[] local_mapping_;
74
75     // ==================================================================
76
//
77
// Constructor.
78
//
79
// ==================================================================
80

81     /**
82      * The constructor with the parent scope.
83      *
84      * @param parent The parent scope of the declaration.
85      */

86     protected
87     HomeOperationBaseImpl(Repository rep,
88                           ScopeImpl parent)
89     {
90         // Call the OperationDeclImpl constructor.
91
super(rep, parent);
92
93         // Init internal state.
94
client_mapping_ = null;
95         local_mapping_ = null;
96     }
97
98     // ==================================================================
99
//
100
// Internal methods.
101
//
102
// ==================================================================
103

104     // ==================================================================
105
//
106
// Public methods.
107
//
108
// ==================================================================
109

110     // ==================================================================
111
//
112
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithDependencies
113
//
114
// ==================================================================
115

116     // ==================================================================
117
//
118
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
119
//
120
// ==================================================================
121

122     // ==================================================================
123
//
124
// Methods for OMG IDL org.objectweb.openccm.ast.api.OperationDecl
125
//
126
// ==================================================================
127

128     // ==================================================================
129
//
130
// Methods for OMG IDL org.objectweb.openccm.ast.api.ClientOperationMapping
131
//
132
// ==================================================================
133

134     /**
135      * Obtain the client operation mapping.
136      *
137      * @return The client operation mapping.
138      */

139     public OperationDecl[]
140     getClientMapping()
141     {
142         if (client_mapping_ == null)
143         {
144             // retrieve the client mapping interface.
145
InterfaceDecl client = ((HomeDecl)the_parent_).
146                                    getClientExplicitMapping();
147             client.getContents(true, DeclarationKind.dk_null);
148
149             client_mapping_ = new OperationDecl[1];
150             client_mapping_[0] = (OperationDecl)client.find(getName());
151         }
152         return client_mapping_;
153     }
154
155     // ==================================================================
156
//
157
// Methods for OMG IDL org.objectweb.openccm.ast.api.LocalOperationMapping
158
//
159
// ==================================================================
160

161     /**
162      * Obtain the local operation mapping.
163      *
164      * @return The local operation mapping.
165      */

166     public OperationDecl[]
167     getLocalMapping()
168     {
169         if (local_mapping_ == null)
170         {
171             // retrieve the local mapping interface.
172
InterfaceDecl local = ((HomeDecl)the_parent_).getLocalMapping();
173             local.getContents(true, DeclarationKind.dk_null);
174
175             local_mapping_ = new OperationDecl[1];
176             local_mapping_[0] = (OperationDecl)local.find(getName());
177         }
178         return local_mapping_;
179     }
180
181     // ==================================================================
182
//
183
// Methods for OMG IDL org.objectweb.openccm.ast.api.HomeOperationBase
184
//
185
// ==================================================================
186

187 }
188
Popular Tags