KickJava   Java API By Example, From Geeks To Geeks.

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


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, Mathieu Vadet.
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 /** To use CORBA::ComponentIR::FactoryDef. */
33 import org.omg.CORBA.ComponentIR.FactoryDef;
34 import org.omg.CORBA.ComponentIR.FactoryDefHelper;
35
36 /**
37  * FactoryDeclImpl is a wrapper class for
38  * IDL home factory operation declarations.
39  *
40  *
41  * Inherits from:
42  *
43  * - HomeOperationBaseImpl as these are IDL home operations.
44  *
45  * - FactoryDecl: OMG IDL for home factory operation declarations.
46  *
47  *
48  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
49  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
50  *
51  * @version 0.3
52  */

53
54 public class FactoryDeclImpl
55        extends HomeOperationBaseImpl
56        implements org.objectweb.openccm.ast.api.FactoryDecl
57 {
58     // ==================================================================
59
//
60
// Internal state.
61
//
62
// ==================================================================
63

64     /** Reference to the CORBA 3.0 FactoryDef. */
65     private FactoryDef factory_def_;
66
67     // ==================================================================
68
//
69
// Constructor.
70
//
71
// ==================================================================
72

73     /**
74      * The constructor with the parent scope.
75      *
76      * @param rep The repository of the declaration.
77      * @param parent The parent scope of the declaration.
78      */

79     protected
80     FactoryDeclImpl(Repository rep,
81                     ScopeImpl parent)
82     {
83         // Call the HomeOperationBaseImpl constructor.
84
super(rep, parent);
85
86         // Init internal state.
87
factory_def_ = null;
88     }
89
90     // ==================================================================
91
//
92
// Internal methods.
93
//
94
// ==================================================================
95

96     // ==================================================================
97
//
98
// Internal methods for DeclarationImpl.
99
//
100
// ==================================================================
101

102     /**
103      * Loads infos of the CORBA 3.0 FactoryDef.
104      *
105      * @param contained The FactoryDef to load.
106      */

107     protected void
108     load(org.omg.CORBA.Contained JavaDoc contained)
109     {
110         factory_def_ = FactoryDefHelper.narrow(contained);
111         super.load(contained);
112     }
113
114     /**
115      * Obtain its CORBA 3.0 Contained reference.
116      *
117      * @return The Contained object associated with the factory declaration.
118      */

119     protected org.omg.CORBA.Contained JavaDoc
120     getContained()
121     {
122        return factory_def_;
123     }
124
125     // ==================================================================
126
//
127
// Public methods.
128
//
129
// ==================================================================
130

131     // ==================================================================
132
//
133
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithDependencies
134
//
135
// ==================================================================
136

137     // ==================================================================
138
//
139
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
140
//
141
// ==================================================================
142

143     /**
144      * Create the factory declaration into the IFR.
145      */

146     public void
147     create()
148     {
149         factory_def_ = the_parent_.getHomeDef().
150                        create_factory(getId(), getName(), getVersion(),
151                                       parameters_.getParameterDescriptionSeq(),
152                                       exceptions_.getExceptionDefSeq());
153     }
154
155     /**
156      * Obtain its DeclarationKind.
157      *
158      * @return The DeclarationKind of the object.
159      */

160     public long
161     getDeclKind()
162     {
163         return DeclarationKind.dk_factory;
164     }
165
166     // ==================================================================
167
//
168
// Methods for OMG IDL org.objectweb.openccm.ast.api.OperationDecl
169
//
170
// ==================================================================
171

172     // ==================================================================
173
//
174
// Methods for OMG IDL org.objectweb.openccm.ast.api.ClientOperationMapping
175
//
176
// ==================================================================
177

178     // ==================================================================
179
//
180
// Methods for OMG IDL org.objectweb.openccm.ast.api.LocalOperationMapping
181
//
182
// ==================================================================
183

184     // ==================================================================
185
//
186
// Methods for OMG IDL org.objectweb.openccm.ast.api.HomeOperationBase
187
//
188
// ==================================================================
189

190     // ==================================================================
191
//
192
// Methods for OMG IDL org.objectweb.openccm.ast.api.FactoryDecl
193
//
194
// ==================================================================
195

196 }
197
Popular Tags