KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Containers > MetaInformation > MI_TypeFactory


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

27 package org.objectweb.openccm.Containers.MetaInformation;
28
29 /**
30  * @author hameau
31  *
32  * To change the template for this generated type comment go to
33  * Window>Preferences>Java>Code Generation>Code and Comments
34  */

35 public class MI_TypeFactory
36 extends TypeImpl
37 {
38   private InterfaceTypeImpl _tmp_inf;
39   private OperationTypeImpl _tmp_op;
40   private AttributeTypeImpl _tmp_att;
41   private FacetPortTypeImpl _tmp_fpt;
42   private ReceptaclePortTypeImpl _tmp_rpt;
43   private ConsumerPortTypeImpl _tmp_cpt;
44   private EmitterPortTypeImpl _tmp_ept;
45   private PublisherPortTypeImpl _tmp_ppt;
46   
47   /**
48     * create_interface_type
49     *
50     * This operation returns a new and
51     * configurated InterfaceType class instance
52     *
53     * @param name - Name of interface.
54     * @param rep_id - IDL OMG repository identifier
55     * @param entrypt - Entry point of the interface type MI
56     * @param ik - Type_kind of related type object, the
57     * value should be :
58     * * COMPONENT_TYPE
59     * * HOME_TYPE
60     * * FACET_TYPE
61     * * RECEPTACLE_TYPE
62     * @param ref - Reference to the related type MI object.
63     *
64      @return InterfaceType
65     *
66     * Created on 21 ao?t 2003
67     */

68   
69   public InterfaceType create_interface_type(
70     String JavaDoc name,
71     String JavaDoc rep_id,
72     String JavaDoc entrypt,
73     type_kind ik,
74     TypeImpl ref
75     )
76   {
77     _tmp_inf = new InterfaceTypeImpl();
78     
79     _tmp_inf._type = ref;
80     _tmp_inf._rep_id = rep_id;
81     _tmp_inf._type_instance_factory_entrypt = entrypt;
82     _tmp_inf._name = name;
83     _tmp_inf._type_kind = ik;
84
85     
86     return _tmp_inf;
87   }
88   
89   /**
90     * create_operation_type
91     *
92     * This operation returns a new and
93     * configurated OperationType class instance
94     *
95     * @param name - Name of operation.
96     * @param rep_id - IDL OMG repository identifier
97     * @param entrypt - Entry point of the operation type MI
98     * @param ik - Type_kind of related type obkect (here
99     * should be set to INTERFACE_TYPE value.
100     * @param ref - Reference to the related InterfaceType object.
101     *
102      @return OperationType
103     *
104     * Created on 21 ao?t 2003
105     */

106   
107   public OperationType create_operation_type(
108     String JavaDoc name,
109     String JavaDoc rep_id,
110     String JavaDoc entrypt,
111     type_kind ik,
112     TypeImpl ref
113     
114   )
115   {
116     _tmp_op = new OperationTypeImpl();
117     
118     _tmp_op._type = ref;
119     _tmp_op._rep_id = rep_id;
120     _tmp_op._name = name;
121     _tmp_op._type_kind = ik;
122     _tmp_op._type_instance_factory_entrypt = entrypt;
123         
124     return _tmp_op;
125   }
126   
127   /**
128     * create_attribute_type
129     *
130     * This operation returns a new and
131     * configurated OperationType class instance
132     *
133     * @param name - Name of attribute.
134     * @param rep_id - IDL OMG repository identifier
135     * @param entrypt - Entry point of the attribute type MI
136     * @param ik - Type_kind of related type object. This
137     * value should be:
138     * * COMPONENT_TYPE
139     * * HOME_TYPE
140     * * INTERFACE_TYPE
141     * @param ref_type - Reference to the related object.
142     * @param ref_int - reference to the reated interface.
143     *
144      @return AttributeType
145     *
146     * Created on 21 ao?t 2003
147     */

148   
149     public AttributeType create_attribute_type(
150       String JavaDoc name,
151       String JavaDoc rep_id,
152       String JavaDoc entrypt,
153       type_kind ik,
154       TypeImpl ref_type
155     )
156     {
157       _tmp_att = new AttributeTypeImpl();
158     
159       _tmp_att._type = ref_type;
160       _tmp_att._rep_id = rep_id;
161       _tmp_att._name = name;
162       _tmp_att._type_kind = ik;
163       _tmp_att._type_instance_factory_entrypt = entrypt;
164         
165       return _tmp_att;
166     }
167     
168   /**
169     * create_facet_port_type
170     *
171     * This operation returns a new and
172     * configurated OperationType class instance
173     *
174     * @param name - Name of facet_port.
175     * @param rep_id - IDL OMG repository identifier
176     * @param entrypt - Entry point of the facet_port type MI
177     * @param ik - Type_kind of related type object. This
178     * value should be COMPONENT_TYPE.
179     * @param ref - Reference to the related object.
180     *
181      @return OperationType
182     *
183     * Created on 21 ao?t 2003
184     */

185
186     public FacetPortType create_facet_port_type(
187       String JavaDoc name,
188       String JavaDoc rep_id,
189       String JavaDoc entrypt,
190       type_kind ik,
191       TypeImpl ref
192    )
193     {
194       _tmp_fpt = new FacetPortTypeImpl();
195   
196       _tmp_fpt._rep_id = rep_id;
197       _tmp_fpt._name = name;
198       _tmp_fpt._type_kind = ik;
199       _tmp_fpt._type_instance_factory_entrypt = entrypt;
200       
201       _tmp_fpt._interface_type = null;
202       
203       return _tmp_fpt;
204     }
205     
206   
207   public FacetPortType facet_bind(InterfaceType type_ref)
208   {
209    try
210     {
211        _tmp_fpt._interface_type = type_ref;
212     }
213     catch (ClassCastException JavaDoc e)
214     {
215       System.err.println("Enable to cast from Type to InterfacesType :-( in facet");
216     };
217     
218     return _tmp_fpt;
219   }
220     
221   /**
222     * create_receptacle_port_type
223     *
224     * This operation returns a new and
225     * configurated OperationType class instance
226     *
227     * @param name - Name of facet_port.
228     * @param rep_id - IDL OMG repository identifier
229     * @param entrypt - Entry point of the receptacle port type MI
230     * @param ik - Type_kind of related type object. This
231     * value should be COMPONENT_TYPE.
232     * @param ref - Reference to the related object.
233     *
234      @return OperationType
235     *
236     * Created on 21 ao?t 2003
237     */

238
239     public ReceptaclePortType create_receptacle_port_type(
240       String JavaDoc name,
241       String JavaDoc rep_id,
242       String JavaDoc entrypt,
243       type_kind ik,
244       TypeImpl ref,
245       boolean multiplex,
246       int max_connections
247   
248     )
249     {
250       _tmp_rpt = new ReceptaclePortTypeImpl();
251   
252       _tmp_rpt._is_multiple = multiplex;
253       _tmp_rpt._max_connections = max_connections;
254       _tmp_rpt._type = ref;
255       _tmp_rpt._rep_id = rep_id;
256       _tmp_rpt._name = name;
257       _tmp_rpt._type_kind = ik;
258       _tmp_rpt._type_instance_factory_entrypt = entrypt;
259       _tmp_rpt._interface_type = null;
260       
261       return _tmp_rpt;
262     }
263     
264     public ReceptaclePortType receptacle_bind(InterfaceType type_ref)
265     {
266      try
267       {
268         _tmp_rpt._interface_type = type_ref;
269       }
270       catch (ClassCastException JavaDoc e)
271       {
272         System.err.println("Enable to assign InterfacesType :-( in receptacle");
273       };
274     
275       return _tmp_rpt;
276     }
277     
278   /**
279     * create_consumer_port_type
280     *
281     * This operation returns a new and
282     * configurated ReceptaclePortType class instance
283     *
284     * @param name - Name of consumer port.
285     * @param rep_id - IDL OMG repository identifier
286     * @param entrypt - Entry point of the consumer port type MI
287     * @param ik - Type_kind of related type object. This
288     * value should be COMPONENT_TYPE.
289     * @param ref - Reference to the related object.
290     *
291      @return ConsumerPortType
292     *
293     * Created on 21 ao?t 2003
294     */

295
296     public ConsumerPortType create_consumer_port_type(
297       String JavaDoc name,
298       String JavaDoc rep_id,
299       String JavaDoc entrypt,
300       type_kind ik,
301       TypeImpl ref
302   
303     )
304     {
305       _tmp_cpt = new ConsumerPortTypeImpl();
306   
307       _tmp_cpt._type = ref;
308       _tmp_cpt._rep_id = rep_id;
309       _tmp_cpt._name = name;
310       _tmp_cpt._type_kind = ik;
311       _tmp_cpt._type_instance_factory_entrypt = entrypt;
312       
313       return _tmp_cpt;
314     }
315     
316   /**
317     * create_emitter_port_type
318     *
319     * This operation returns a new and
320     * configurated EmitterPortType class instance
321     *
322     * @param name - Name of consumer port.
323     * @param rep_id - IDL OMG repository identifier
324     * @param entrypt - Entry point of the emitter port type MI
325     * @param ik - Type_kind of related type object. This
326     * value should be COMPONENT_TYPE.
327     * @param ref - Reference to the related object.
328     *
329      @return EmitterPortType
330     *
331     * Created on 21 ao?t 2003
332     */

333
334     public EmitterPortType create_emitter_port_type(
335       String JavaDoc name,
336       String JavaDoc rep_id,
337       String JavaDoc entrypt,
338       type_kind ik,
339       TypeImpl ref
340     )
341     {
342       _tmp_ept = new EmitterPortTypeImpl();
343   
344       _tmp_ept._type = ref;
345       _tmp_ept._rep_id = rep_id;
346       _tmp_ept._name = name;
347       _tmp_ept._type_kind = ik;
348       _tmp_ept._type_instance_factory_entrypt = entrypt;
349       
350       return _tmp_ept;
351     }
352     
353   /**
354     * create_publisher_port_type
355     *
356     * This operation returns a new and
357     * configurated EmitterPortType class instance
358     *
359     * @param name - Name of publisher port.
360     * @param rep_id - IDL OMG repository identifier
361     * @param entrypt - Entry point of the publisher port type MI
362     * @param ik - Type_kind of related type object. This
363     * value should be COMPONENT_TYPE.
364     * @param ref - Reference to the related object.
365     *
366      @return PublisherPortType
367     *
368     * Created on 21 ao?t 2003
369     */

370
371     public PublisherPortType create_publisher_port_type(
372       String JavaDoc name,
373       String JavaDoc rep_id,
374       String JavaDoc entrypt,
375       type_kind ik,
376       TypeImpl ref
377     )
378     {
379       _tmp_ppt = new PublisherPortTypeImpl();
380   
381       _tmp_ppt._type = ref;
382       _tmp_ppt._rep_id = rep_id;
383       _tmp_ppt._name = name;
384       _tmp_ppt._type_kind = ik;
385       _tmp_ppt._type_instance_factory_entrypt = entrypt;
386       
387       return _tmp_ppt;
388     }
389
390 }
391
Popular Tags