KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > ExtInterfaceDef_impl


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): Mathieu Vadet, Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ir3;
28
29 // Package dependencies
30
import org.omg.CORBA.*;
31 import org.omg.CORBA.ExtInterfaceDefPackage.ExtFullInterfaceDescription;
32
33 /**
34  * Implementation of the CORBA::ExtInterfaceDef interface.
35  *
36  * @author <a=href="Philippe.Merle@lifl.fr">Philippe Merle</a>
37  * <a=href="Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
38  *
39  * @version 0.3
40  */

41
42 public class ExtInterfaceDef_impl
43        extends InterfaceDef_impl
44        implements ExtInterfaceDefOperations
45 {
46     // ==================================================================
47
//
48
// Constructors.
49
//
50
// ==================================================================
51

52     /**
53      * TODO
54      */

55     public
56     ExtInterfaceDef_impl(IFR ifr,
57                          Container_impl container)
58     {
59         this(ifr, container, false);
60
61         // set the tie servant object.
62
setServant(new ExtInterfaceDefPOATie(this));
63     }
64
65     /**
66      * TODO
67      */

68     public
69     ExtInterfaceDef_impl(IFR ifr,
70                          Container_impl container,
71                          boolean dummy)
72     {
73         // call the Container_impl contructor.
74
super(ifr, container, dummy);
75     }
76
77     // ==================================================================
78
//
79
// Internal state.
80
//
81
// ==================================================================
82

83     // ==================================================================
84
//
85
// Public methods.
86
//
87
// ==================================================================
88

89     /**
90      * Obtain its CORBA::ExtInterfaceDef object reference.
91      */

92     public ExtInterfaceDef
93     asExtInterfaceDef()
94     {
95         return ExtInterfaceDefHelper.narrow(asObject());
96     }
97
98     // ==================================================================
99
//
100
// For CORBA::InterfaceDef interface.
101
//
102
// ==================================================================
103

104     /**
105      * IDL:omg.org/CORBA/InterfaceDef/create_attribute:1.0
106      */

107     public AttributeDef
108     create_attribute(String JavaDoc id,
109                      String JavaDoc name,
110                      String JavaDoc version,
111                      IDLType type,
112                      AttributeMode mode)
113     {
114         ExtAttributeDef_impl attr = new ExtAttributeDef_impl(getIFR(), this);
115
116         try
117         {
118             addContained(attr, id, name, version);
119             attr.type_def(type);
120             attr.mode(mode);
121             attr.get_exceptions(new ExceptionDef[0]);
122             attr.set_exceptions(new ExceptionDef[0]);
123         }
124         catch(SystemException exc)
125         {
126             attr.destroy();
127             throw exc;
128         }
129
130         attr.whenCreated();
131         return attr.asAttributeDef();
132     }
133
134     // ==================================================================
135
//
136
// For CORBA::ExtInterfaceDef interface.
137
//
138
// ==================================================================
139

140     /**
141      * IDL:omg.org/CORBA/ExtInterfaceDef/create_attribute:1.0
142      */

143     public ExtAttributeDef
144     create_ext_attribute(String JavaDoc id,
145                          String JavaDoc name,
146                          String JavaDoc version,
147                          IDLType type,
148                          AttributeMode mode,
149                          ExceptionDef[] get_exceptions,
150                          ExceptionDef[] set_exceptions)
151     {
152         ExtAttributeDef_impl attr = new ExtAttributeDef_impl(getIFR(), this);
153
154         try
155         {
156             addContained(attr, id, name, version);
157             attr.type_def(type);
158             attr.mode(mode);
159             attr.get_exceptions(get_exceptions);
160             attr.set_exceptions(set_exceptions);
161         }
162         catch(SystemException exc)
163         {
164             attr.destroy();
165             throw exc;
166         }
167
168         attr.whenCreated();
169         return attr.asExtAttributeDef();
170     }
171
172     /**
173      * IDL:omg.org/CORBA/InterfaceDef/describe_ext_interface:1.0
174      */

175     public ExtFullInterfaceDescription
176     describe_ext_interface()
177     {
178         ExtFullInterfaceDescription description = new ExtFullInterfaceDescription();
179         description.name = name();
180         description.id = id();
181         description.defined_in = getContainerID();
182         description.version = version();
183         description.operations = getOpDescriptionSeq();
184         description.attributes = getExtAttrDescriptionSeq();
185         description.base_interfaces =
186                 InterfaceDef_ref.computeRepositoryIdSeq(base_interfaces_);
187         description.type = type();
188         return description;
189     }
190 }
191
Popular Tags