KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > WstringDef_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
32 /**
33  * Implementation of the CORBA::WstringDef interface.
34  *
35  * @author <a=href="Philippe.Merle@lifl.fr">Philippe Merle</a>
36  * <a=href="Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
37  *
38  * @version 0.3
39  */

40
41 public class WstringDef_impl
42        extends IRObject_impl
43        implements WstringDefOperations
44 {
45     // ==================================================================
46
//
47
// Internal state.
48
//
49
// ==================================================================
50

51     /** The string bound. */
52     protected int bound_;
53
54     // ==================================================================
55
//
56
// Constructor.
57
//
58
// ==================================================================
59

60     /**
61      * TODO
62      */

63     public
64     WstringDef_impl(IFR ifr)
65     {
66         // call the IRObject_impl contructor.
67
super(ifr);
68
69         // set the TIE servant object.
70
setServant(new WstringDefPOATie(this));
71
72         // set the bound to zero.
73
bound_ = 0;
74     }
75
76     // ==================================================================
77
//
78
// Internal methods inherited from IROject_impl.
79
//
80
// ==================================================================
81

82     /**
83      * Warning : this operation must be implemented by subclasses.
84      * It allows us to avoid some casts while creating ::CORBA::TypeCode
85      */

86     protected TypeCode
87     recursiveType(java.util.List JavaDoc idSeq)
88     {
89         return type();
90     }
91
92     // ==================================================================
93
//
94
// Public methods.
95
//
96
// ==================================================================
97

98     /**
99      * Obtain its CORBA::WstringDef object reference.
100      */

101     public WstringDef
102     asWstringDef()
103     {
104         return WstringDefHelper.narrow(asObject());
105     }
106
107     // ==================================================================
108
//
109
// For CORBA::IRObject interface.
110
//
111
// ==================================================================
112

113     /**
114      * IDL:omg.org/CORBA/IRObject/def_kind:1.0
115      */

116     public DefinitionKind
117     def_kind()
118     {
119         return DefinitionKind.dk_Wstring;
120     }
121
122     // ==================================================================
123
//
124
// For CORBA::IDLType interface.
125
//
126
// ==================================================================
127

128     /**
129      * IDL:omg.org/CORBA/IDLType/type:1.0
130      */

131     public TypeCode
132     type()
133     {
134         // delegates to the TypeCodeFactory.
135
return getIFR().getTCF().create_wstring_tc(bound());
136     }
137
138     // ==================================================================
139
//
140
// For CORBA::WstringDef interface.
141
//
142
// ==================================================================
143

144     /**
145      * IDL:omg.org/CORBA/WstringDef/bound:1.0
146      */

147     public int
148     bound()
149     {
150         return bound_;
151     }
152
153     /**
154      * IDL:omg.org/CORBA/WstringDef/bound:1.0
155      */

156     public void
157     bound(int b)
158     {
159         if(b == 0)
160             throw exceptionBadParam("the wstring bound can't be set to zero");
161
162         bound_ = b;
163     }
164 }
165
Popular Tags