KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > ExtAbstractInterfaceDef_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::ExtAbstractInterfaceDef 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 ExtAbstractInterfaceDef_impl
42        extends ExtInterfaceDef_impl
43        implements ExtAbstractInterfaceDefOperations
44 {
45     // ==================================================================
46
//
47
// Constructors.
48
//
49
// ==================================================================
50

51     /**
52      * TODO
53      */

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

71     // ==================================================================
72
//
73
// Internal methods.
74
//
75
// ==================================================================
76

77     /**
78      * Obtain its CORBA::ExtAbstractInterfaceDef object reference.
79      */

80     public ExtAbstractInterfaceDef
81     asExtAbstractInterfaceDef()
82     {
83         return ExtAbstractInterfaceDefHelper.narrow(asObject());
84     }
85
86     /**
87      * TODO
88      */

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

105     /**
106      * IDL:omg.org/CORBA/IRObject/def_kind:1.0
107      */

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

120     /**
121      * IDL:omg.org/CORBA/IDLType/type:1.0
122      */

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

136     /**
137      * IDL:omg.org/CORBA/InterfaceDef/base_interfaces:1.0
138      */

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

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