KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > AbstractInterfaceDef_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::AbstractInterfaceDef 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 AbstractInterfaceDef_impl
42        extends InterfaceDef_impl
43        implements AbstractInterfaceDefOperations
44 {
45     // ==================================================================
46
//
47
// Constructors.
48
//
49
// ==================================================================
50

51     public
52     AbstractInterfaceDef_impl(IFR ifr,
53                               Container_impl container)
54     {
55         // call the InterfaceDef_impl constructor.
56
super(ifr, container, false);
57
58         // set the tie servant object.
59
setServant(new AbstractInterfaceDefPOATie(this));
60     }
61
62     // ==================================================================
63
//
64
// Internal state.
65
//
66
// ==================================================================
67

68     // ==================================================================
69
//
70
// Internal methods.
71
//
72
// ==================================================================
73

74     /**
75      * Obtain its CORBA::AbstractInterfaceDef object reference.
76      */

77     public AbstractInterfaceDef
78     asAbstractInterfaceDef()
79     {
80         return AbstractInterfaceDefHelper.narrow(asObject());
81     }
82
83     /**
84      * TODO
85      */

86     public void
87     base_interfaces(AbstractInterfaceDef[] val)
88     {
89         InterfaceDef[] tmp = new InterfaceDef[val.length];
90         for(int i=0; i<tmp.length; i++)
91             tmp[i] = val[i];
92
93         super.base_interfaces(tmp);
94     }
95
96     // ==================================================================
97
//
98
// For CORBA::IRObject interface.
99
//
100
// ==================================================================
101

102     /**
103      * IDL:omg.org/CORBA/IRObject/def_kind:1.0
104      */

105     public DefinitionKind
106     def_kind()
107     {
108         return DefinitionKind.dk_AbstractInterface;
109     }
110
111     // ==================================================================
112
//
113
// For CORBA::IDLType interface.
114
//
115
// ==================================================================
116

117     /**
118      * IDL:omg.org/CORBA/IDLType/type:1.0
119      */

120     public TypeCode
121     type()
122     {
123         // delegate to the TypeCodeFactory.
124
return getIFR().getTCF().create_abstract_interface_tc(id(), name());
125     }
126
127     // ==================================================================
128
//
129
// For CORBA::InterfaceDef interface.
130
//
131
// ==================================================================
132

133     /**
134      * IDL:omg.org/CORBA/InterfaceDef/base_interfaces:1.0
135      */

136     public void
137     base_interfaces(InterfaceDef[] itfs)
138     {
139         // Check that all itfs are AbstractInterfaceDef.
140
for(int i=0; i<itfs.length; i++)
141             if(itfs[i].def_kind() != DefinitionKind.dk_AbstractInterface)
142                 throw exceptionInvalidAbstractInterfaceInheritance(
143                                                   itfs[i].absolute_name());
144
145         super.base_interfaces(itfs);
146     }
147
148     /**
149      * IDL:omg.org/CORBA/InterfaceDef/is_a:1.0
150      */

151     public boolean
152     is_a(String JavaDoc interface_id)
153     {
154         if(interface_id.equals(id()))
155             return true;
156
157         if(interface_id.equals("IDL:omg.org/CORBA/AbstractBase:1.0"))
158             return true;
159
160         for(int i=0; i<base_interfaces_.length; i++)
161             if (base_interfaces_[i].getImpl().is_a(interface_id))
162                 return true;
163
164         return false;
165     }
166 }
167
Popular Tags