Fri, 24 Sep 2010 22:42:14 -0700
6891766: Vulnerabilities in use of reflection in CORBA
Reviewed-by: hawtin
duke@1 | 1 | /* |
ohair@158 | 2 | * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@158 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@158 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@158 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@158 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@158 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | /* |
duke@1 | 27 | * This file contains OMG IDL from CORBA V2.0, July 1995. |
duke@1 | 28 | * It also contains the TypeCode creation APIs in CORBA::ORB |
duke@1 | 29 | **/ |
duke@1 | 30 | |
duke@1 | 31 | #pragma prefix "omg.org" |
duke@1 | 32 | //#pragma javaPackage org.omg |
duke@1 | 33 | |
duke@1 | 34 | module CORBA { |
duke@1 | 35 | typedef string Identifier; |
duke@1 | 36 | typedef string ScopedName; |
duke@1 | 37 | typedef string RepositoryId; |
duke@1 | 38 | |
duke@1 | 39 | enum DefinitionKind { |
duke@1 | 40 | dk_none, dk_all, |
duke@1 | 41 | dk_Attribute, dk_Constant, dk_Exception, dk_Interface, |
duke@1 | 42 | dk_Module, dk_Operation, dk_Typedef, |
duke@1 | 43 | dk_Alias, dk_Struct, dk_Union, dk_Enum, |
duke@1 | 44 | dk_Primitive, dk_String, dk_Sequence, dk_Array, |
duke@1 | 45 | dk_Repository, |
duke@1 | 46 | dk_Wstring, dk_Fixed, |
duke@1 | 47 | dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value |
duke@1 | 48 | dk_Native |
duke@1 | 49 | }; |
duke@1 | 50 | |
duke@1 | 51 | |
duke@1 | 52 | interface IRObject |
duke@1 | 53 | /** |
duke@1 | 54 | An IRObject IDL interface represents the most generic interface |
duke@1 | 55 | from which all other Interface Repository interfaces are derived, |
duke@1 | 56 | even the Repository itself. |
duke@1 | 57 | */ |
duke@1 | 58 | { |
duke@1 | 59 | // read interface |
duke@1 | 60 | readonly attribute DefinitionKind def_kind; |
duke@1 | 61 | |
duke@1 | 62 | // write interface |
duke@1 | 63 | void destroy (); |
duke@1 | 64 | }; |
duke@1 | 65 | |
duke@1 | 66 | |
duke@1 | 67 | |
duke@1 | 68 | typedef string VersionSpec; |
duke@1 | 69 | |
duke@1 | 70 | interface Contained; |
duke@1 | 71 | interface Repository; |
duke@1 | 72 | interface Container; |
duke@1 | 73 | |
duke@1 | 74 | interface Contained : IRObject |
duke@1 | 75 | /** |
duke@1 | 76 | The Contained Interface is inherited by all Interface Repository |
duke@1 | 77 | interfaces that are contained by other objects. |
duke@1 | 78 | */ |
duke@1 | 79 | { |
duke@1 | 80 | // read/write interface |
duke@1 | 81 | |
duke@1 | 82 | attribute RepositoryId id; |
duke@1 | 83 | attribute Identifier name; |
duke@1 | 84 | attribute VersionSpec version; |
duke@1 | 85 | |
duke@1 | 86 | // read interface |
duke@1 | 87 | |
duke@1 | 88 | readonly attribute Container defined_in; |
duke@1 | 89 | readonly attribute ScopedName absolute_name; |
duke@1 | 90 | readonly attribute Repository containing_repository; |
duke@1 | 91 | |
duke@1 | 92 | struct Description { |
duke@1 | 93 | DefinitionKind kind; |
duke@1 | 94 | any value; |
duke@1 | 95 | }; |
duke@1 | 96 | |
duke@1 | 97 | Description describe (); |
duke@1 | 98 | |
duke@1 | 99 | // write interface |
duke@1 | 100 | |
duke@1 | 101 | void move ( |
duke@1 | 102 | in Container new_container, |
duke@1 | 103 | in Identifier new_name, |
duke@1 | 104 | in VersionSpec new_version |
duke@1 | 105 | ); |
duke@1 | 106 | }; |
duke@1 | 107 | |
duke@1 | 108 | |
duke@1 | 109 | interface ModuleDef; |
duke@1 | 110 | interface ConstantDef; |
duke@1 | 111 | interface IDLType; |
duke@1 | 112 | interface StructDef; |
duke@1 | 113 | interface UnionDef; |
duke@1 | 114 | interface EnumDef; |
duke@1 | 115 | interface AliasDef; |
duke@1 | 116 | interface InterfaceDef; |
duke@1 | 117 | interface ExceptionDef; |
duke@1 | 118 | interface ValueDef; // orbos 98-01-18: Objects By Value |
duke@1 | 119 | interface ValueMemberDef; // orbos 98-01-18: Objects By Value |
duke@1 | 120 | interface ValueBoxDef; // orbos 98-01-18: Objects By Value |
duke@1 | 121 | interface NativeDef; |
duke@1 | 122 | |
duke@1 | 123 | |
duke@1 | 124 | typedef sequence <InterfaceDef> InterfaceDefSeq; |
duke@1 | 125 | |
duke@1 | 126 | |
duke@1 | 127 | typedef sequence <Contained> ContainedSeq; |
duke@1 | 128 | |
duke@1 | 129 | struct StructMember { |
duke@1 | 130 | Identifier name; |
duke@1 | 131 | TypeCode type; |
duke@1 | 132 | IDLType type_def; |
duke@1 | 133 | }; |
duke@1 | 134 | typedef sequence <StructMember> StructMemberSeq; |
duke@1 | 135 | |
duke@1 | 136 | struct UnionMember { |
duke@1 | 137 | Identifier name; |
duke@1 | 138 | any label; |
duke@1 | 139 | TypeCode type; |
duke@1 | 140 | IDLType type_def; |
duke@1 | 141 | }; |
duke@1 | 142 | typedef sequence <UnionMember> UnionMemberSeq; |
duke@1 | 143 | |
duke@1 | 144 | |
duke@1 | 145 | typedef sequence <Identifier> EnumMemberSeq; |
duke@1 | 146 | |
duke@1 | 147 | // orbos 98-01-18: Objects By Value -- begin |
duke@1 | 148 | typedef short Visibility; |
duke@1 | 149 | const Visibility PRIVATE_MEMBER = 0; |
duke@1 | 150 | const Visibility PUBLIC_MEMBER = 1; |
duke@1 | 151 | |
duke@1 | 152 | struct ValueMember { |
duke@1 | 153 | Identifier name; |
duke@1 | 154 | RepositoryId id; |
duke@1 | 155 | RepositoryId defined_in; |
duke@1 | 156 | VersionSpec version; |
duke@1 | 157 | TypeCode type; |
duke@1 | 158 | IDLType type_def; |
duke@1 | 159 | Visibility access; |
duke@1 | 160 | }; |
duke@1 | 161 | typedef sequence <ValueMember> ValueMemberSeq; |
duke@1 | 162 | |
duke@1 | 163 | struct Initializer { |
duke@1 | 164 | StructMemberSeq members; |
duke@1 | 165 | }; |
duke@1 | 166 | typedef sequence <Initializer> InitializerSeq; |
duke@1 | 167 | |
duke@1 | 168 | typedef sequence <ValueDef> ValueDefSeq; |
duke@1 | 169 | |
duke@1 | 170 | // orbos 98-01-18: Objects By Value -- end |
duke@1 | 171 | |
duke@1 | 172 | |
duke@1 | 173 | interface Container : IRObject |
duke@1 | 174 | /** |
duke@1 | 175 | The Container interface is used to form a containment hierarchy |
duke@1 | 176 | in the Interface Repository. A Container can contain any number |
duke@1 | 177 | of objects derived from the Contained interface. |
duke@1 | 178 | */ |
duke@1 | 179 | { |
duke@1 | 180 | // read interface |
duke@1 | 181 | |
duke@1 | 182 | Contained lookup ( in ScopedName search_name); |
duke@1 | 183 | |
duke@1 | 184 | ContainedSeq contents ( |
duke@1 | 185 | in DefinitionKind limit_type, |
duke@1 | 186 | in boolean exclude_inherited |
duke@1 | 187 | ); |
duke@1 | 188 | |
duke@1 | 189 | ContainedSeq lookup_name ( |
duke@1 | 190 | in Identifier search_name, |
duke@1 | 191 | in long levels_to_search, |
duke@1 | 192 | in DefinitionKind limit_type, |
duke@1 | 193 | in boolean exclude_inherited |
duke@1 | 194 | ); |
duke@1 | 195 | |
duke@1 | 196 | struct Description { |
duke@1 | 197 | Contained contained_object; |
duke@1 | 198 | DefinitionKind kind; |
duke@1 | 199 | any value; |
duke@1 | 200 | }; |
duke@1 | 201 | |
duke@1 | 202 | typedef sequence<Description> DescriptionSeq; |
duke@1 | 203 | |
duke@1 | 204 | DescriptionSeq describe_contents ( |
duke@1 | 205 | in DefinitionKind limit_type, |
duke@1 | 206 | in boolean exclude_inherited, |
duke@1 | 207 | in long max_returned_objs |
duke@1 | 208 | ); |
duke@1 | 209 | |
duke@1 | 210 | // write interface |
duke@1 | 211 | |
duke@1 | 212 | ModuleDef create_module ( |
duke@1 | 213 | in RepositoryId id, |
duke@1 | 214 | in Identifier name, |
duke@1 | 215 | in VersionSpec version |
duke@1 | 216 | ); |
duke@1 | 217 | |
duke@1 | 218 | ConstantDef create_constant ( |
duke@1 | 219 | in RepositoryId id, |
duke@1 | 220 | in Identifier name, |
duke@1 | 221 | in VersionSpec version, |
duke@1 | 222 | in IDLType type, |
duke@1 | 223 | in any value |
duke@1 | 224 | ); |
duke@1 | 225 | |
duke@1 | 226 | StructDef create_struct ( |
duke@1 | 227 | in RepositoryId id, |
duke@1 | 228 | in Identifier name, |
duke@1 | 229 | in VersionSpec version, |
duke@1 | 230 | in StructMemberSeq members |
duke@1 | 231 | ); |
duke@1 | 232 | |
duke@1 | 233 | UnionDef create_union ( |
duke@1 | 234 | in RepositoryId id, |
duke@1 | 235 | in Identifier name, |
duke@1 | 236 | in VersionSpec version, |
duke@1 | 237 | in IDLType discriminator_type, |
duke@1 | 238 | in UnionMemberSeq members |
duke@1 | 239 | ); |
duke@1 | 240 | |
duke@1 | 241 | EnumDef create_enum ( |
duke@1 | 242 | in RepositoryId id, |
duke@1 | 243 | in Identifier name, |
duke@1 | 244 | in VersionSpec version, |
duke@1 | 245 | in EnumMemberSeq members |
duke@1 | 246 | ); |
duke@1 | 247 | |
duke@1 | 248 | AliasDef create_alias ( |
duke@1 | 249 | in RepositoryId id, |
duke@1 | 250 | in Identifier name, |
duke@1 | 251 | in VersionSpec version, |
duke@1 | 252 | in IDLType original_type |
duke@1 | 253 | ); |
duke@1 | 254 | |
duke@1 | 255 | ExceptionDef create_exception ( |
duke@1 | 256 | in RepositoryId id, |
duke@1 | 257 | in Identifier name, |
duke@1 | 258 | in VersionSpec version, |
duke@1 | 259 | in StructMemberSeq members |
duke@1 | 260 | ); |
duke@1 | 261 | |
duke@1 | 262 | |
duke@1 | 263 | InterfaceDef create_interface ( |
duke@1 | 264 | in RepositoryId id, |
duke@1 | 265 | in Identifier name, |
duke@1 | 266 | in VersionSpec version, |
duke@1 | 267 | in boolean is_abstract, |
duke@1 | 268 | in InterfaceDefSeq base_interfaces |
duke@1 | 269 | ); |
duke@1 | 270 | |
duke@1 | 271 | // orbos 98-01-18: Objects By Value |
duke@1 | 272 | ValueDef create_value( |
duke@1 | 273 | in RepositoryId id, |
duke@1 | 274 | in Identifier name, |
duke@1 | 275 | in VersionSpec version, |
duke@1 | 276 | in boolean is_custom, |
duke@1 | 277 | in boolean is_abstract, |
duke@1 | 278 | in octet flags, // must be 0 |
duke@1 | 279 | in ValueDef base_value, |
duke@1 | 280 | in boolean has_safe_base, |
duke@1 | 281 | in ValueDefSeq abstract_base_values, |
duke@1 | 282 | in InterfaceDefSeq supported_interfaces, |
duke@1 | 283 | in InitializerSeq initializers |
duke@1 | 284 | ); |
duke@1 | 285 | |
duke@1 | 286 | // orbos 98-01-18: Objects By Value |
duke@1 | 287 | ValueBoxDef create_value_box( |
duke@1 | 288 | in RepositoryId id, |
duke@1 | 289 | in Identifier name, |
duke@1 | 290 | in VersionSpec version, |
duke@1 | 291 | in IDLType original_type_def |
duke@1 | 292 | ); |
duke@1 | 293 | |
duke@1 | 294 | NativeDef create_native( |
duke@1 | 295 | in RepositoryId id, |
duke@1 | 296 | in Identifier name, |
duke@1 | 297 | in VersionSpec version |
duke@1 | 298 | ); |
duke@1 | 299 | |
duke@1 | 300 | }; |
duke@1 | 301 | |
duke@1 | 302 | |
duke@1 | 303 | |
duke@1 | 304 | interface IDLType : IRObject |
duke@1 | 305 | /** |
duke@1 | 306 | The IDLType interface is an abstract interface inherited by all |
duke@1 | 307 | IR objects that represent the OMG IDL types. It provides access |
duke@1 | 308 | to the TypeCode describing the type, and is used in defining the |
duke@1 | 309 | other interfaces wherever definitions of IDLType must be referenced. |
duke@1 | 310 | */ |
duke@1 | 311 | { |
duke@1 | 312 | readonly attribute TypeCode type; |
duke@1 | 313 | }; |
duke@1 | 314 | |
duke@1 | 315 | |
duke@1 | 316 | |
duke@1 | 317 | interface PrimitiveDef; |
duke@1 | 318 | interface StringDef; |
duke@1 | 319 | interface SequenceDef; |
duke@1 | 320 | interface ArrayDef; |
duke@1 | 321 | |
duke@1 | 322 | enum PrimitiveKind { |
duke@1 | 323 | pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, |
duke@1 | 324 | pk_float, pk_double, pk_boolean, pk_char, pk_octet, |
duke@1 | 325 | pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref |
duke@1 | 326 | }; |
duke@1 | 327 | |
duke@1 | 328 | interface Repository : Container |
duke@1 | 329 | /** |
duke@1 | 330 | Repository is an interface that provides global access to the |
duke@1 | 331 | Interface Repository. Repository objects can contain constants, |
duke@1 | 332 | typedefs, exceptions, interfaces, and modules. |
duke@1 | 333 | */ |
duke@1 | 334 | { |
duke@1 | 335 | // read interface |
duke@1 | 336 | |
duke@1 | 337 | Contained lookup_id (in RepositoryId search_id); |
duke@1 | 338 | |
duke@1 | 339 | PrimitiveDef get_primitive (in PrimitiveKind kind); |
duke@1 | 340 | |
duke@1 | 341 | // write interface |
duke@1 | 342 | |
duke@1 | 343 | StringDef create_string (in unsigned long bound); |
duke@1 | 344 | |
duke@1 | 345 | SequenceDef create_sequence ( |
duke@1 | 346 | in unsigned long bound, |
duke@1 | 347 | in IDLType element_type |
duke@1 | 348 | ); |
duke@1 | 349 | |
duke@1 | 350 | ArrayDef create_array ( |
duke@1 | 351 | in unsigned long length, |
duke@1 | 352 | in IDLType element_type |
duke@1 | 353 | ); |
duke@1 | 354 | }; |
duke@1 | 355 | |
duke@1 | 356 | |
duke@1 | 357 | interface ModuleDef : Container, Contained |
duke@1 | 358 | /** |
duke@1 | 359 | A ModuleDef can contain constants, typedefs, exceptions, interfaces, |
duke@1 | 360 | and other module objects. |
duke@1 | 361 | */ |
duke@1 | 362 | { |
duke@1 | 363 | }; |
duke@1 | 364 | |
duke@1 | 365 | struct ModuleDescription { |
duke@1 | 366 | Identifier name; |
duke@1 | 367 | RepositoryId id; |
duke@1 | 368 | RepositoryId defined_in; |
duke@1 | 369 | VersionSpec version; |
duke@1 | 370 | }; |
duke@1 | 371 | |
duke@1 | 372 | |
duke@1 | 373 | interface ConstantDef : Contained |
duke@1 | 374 | /** |
duke@1 | 375 | A ConstantDef object defines a named constant. |
duke@1 | 376 | */ |
duke@1 | 377 | { |
duke@1 | 378 | readonly attribute TypeCode type; |
duke@1 | 379 | attribute IDLType type_def; |
duke@1 | 380 | attribute any value; |
duke@1 | 381 | }; |
duke@1 | 382 | |
duke@1 | 383 | struct ConstantDescription { |
duke@1 | 384 | Identifier name; |
duke@1 | 385 | RepositoryId id; |
duke@1 | 386 | RepositoryId defined_in; |
duke@1 | 387 | VersionSpec version; |
duke@1 | 388 | TypeCode type; |
duke@1 | 389 | any value; |
duke@1 | 390 | }; |
duke@1 | 391 | |
duke@1 | 392 | |
duke@1 | 393 | interface TypedefDef : Contained, IDLType |
duke@1 | 394 | /** |
duke@1 | 395 | TypedefDef is an abstract interface used as a base interface for |
duke@1 | 396 | all named non-object types(structures, unions, enumerations, |
duke@1 | 397 | aliases). The TypedefDef interface is not inherited by the definition |
duke@1 | 398 | objects for the primitive or anonymous types. |
duke@1 | 399 | */ |
duke@1 | 400 | { |
duke@1 | 401 | }; |
duke@1 | 402 | |
duke@1 | 403 | struct TypeDescription { |
duke@1 | 404 | Identifier name; |
duke@1 | 405 | RepositoryId id; |
duke@1 | 406 | RepositoryId defined_in; |
duke@1 | 407 | VersionSpec version; |
duke@1 | 408 | TypeCode type; |
duke@1 | 409 | }; |
duke@1 | 410 | |
duke@1 | 411 | |
duke@1 | 412 | interface StructDef : TypedefDef, Container |
duke@1 | 413 | /** |
duke@1 | 414 | A StructDef represents an OMG IDL structure definition. |
duke@1 | 415 | */ |
duke@1 | 416 | { |
duke@1 | 417 | attribute StructMemberSeq members; |
duke@1 | 418 | }; |
duke@1 | 419 | |
duke@1 | 420 | |
duke@1 | 421 | interface UnionDef : TypedefDef, Container |
duke@1 | 422 | /** |
duke@1 | 423 | A UnionDef represents an OMG IDL union definition. |
duke@1 | 424 | */ |
duke@1 | 425 | { |
duke@1 | 426 | readonly attribute TypeCode discriminator_type; |
duke@1 | 427 | attribute IDLType discriminator_type_def; |
duke@1 | 428 | attribute UnionMemberSeq members; |
duke@1 | 429 | }; |
duke@1 | 430 | |
duke@1 | 431 | |
duke@1 | 432 | interface EnumDef : TypedefDef |
duke@1 | 433 | /** |
duke@1 | 434 | A EnumDef represents an OMG IDL enum definition. |
duke@1 | 435 | */ |
duke@1 | 436 | { |
duke@1 | 437 | attribute EnumMemberSeq members; |
duke@1 | 438 | }; |
duke@1 | 439 | |
duke@1 | 440 | |
duke@1 | 441 | interface AliasDef : TypedefDef |
duke@1 | 442 | /** |
duke@1 | 443 | An AliasDef represents an OMG IDL typedef that aliases other |
duke@1 | 444 | definition. |
duke@1 | 445 | */ |
duke@1 | 446 | { |
duke@1 | 447 | attribute IDLType original_type_def; |
duke@1 | 448 | }; |
duke@1 | 449 | |
duke@1 | 450 | |
duke@1 | 451 | interface PrimitiveDef: IDLType |
duke@1 | 452 | /** |
duke@1 | 453 | A PrimitiveDef represents one of the IDL primitive types. As |
duke@1 | 454 | primitive types are unnamed, this interface is not derived from |
duke@1 | 455 | TypedefDef or Contained. |
duke@1 | 456 | */ |
duke@1 | 457 | { |
duke@1 | 458 | readonly attribute PrimitiveKind kind; |
duke@1 | 459 | }; |
duke@1 | 460 | |
duke@1 | 461 | |
duke@1 | 462 | interface StringDef : IDLType |
duke@1 | 463 | /** |
duke@1 | 464 | A StringDef represents an OMG IDL string type. As string |
duke@1 | 465 | types are anonymous, this interface is not derived from TypedefDef |
duke@1 | 466 | or Contained. |
duke@1 | 467 | */ |
duke@1 | 468 | { |
duke@1 | 469 | attribute unsigned long bound; |
duke@1 | 470 | }; |
duke@1 | 471 | |
duke@1 | 472 | |
duke@1 | 473 | interface SequenceDef : IDLType |
duke@1 | 474 | /** |
duke@1 | 475 | A SequenceDef represents an OMG IDL sequence type. As sequence |
duke@1 | 476 | types are anonymous, this interface is not derived from TypedefDef |
duke@1 | 477 | or Contained. |
duke@1 | 478 | */ |
duke@1 | 479 | { |
duke@1 | 480 | attribute unsigned long bound; |
duke@1 | 481 | readonly attribute TypeCode element_type; |
duke@1 | 482 | attribute IDLType element_type_def; |
duke@1 | 483 | }; |
duke@1 | 484 | |
duke@1 | 485 | interface ArrayDef : IDLType |
duke@1 | 486 | /** |
duke@1 | 487 | An ArrayDef represents an OMG IDL array type. As array |
duke@1 | 488 | types are anonymous, this interface is not derived from TypedefDef |
duke@1 | 489 | or Contained. |
duke@1 | 490 | */ |
duke@1 | 491 | { |
duke@1 | 492 | attribute unsigned long length; |
duke@1 | 493 | readonly attribute TypeCode element_type; |
duke@1 | 494 | attribute IDLType element_type_def; |
duke@1 | 495 | }; |
duke@1 | 496 | |
duke@1 | 497 | |
duke@1 | 498 | interface ExceptionDef : Contained, Container |
duke@1 | 499 | /** |
duke@1 | 500 | An ExceptionDef represents an exception definition. |
duke@1 | 501 | */ |
duke@1 | 502 | { |
duke@1 | 503 | readonly attribute TypeCode type; |
duke@1 | 504 | attribute StructMemberSeq members; |
duke@1 | 505 | }; |
duke@1 | 506 | struct ExceptionDescription { |
duke@1 | 507 | Identifier name; |
duke@1 | 508 | RepositoryId id; |
duke@1 | 509 | RepositoryId defined_in; |
duke@1 | 510 | VersionSpec version; |
duke@1 | 511 | TypeCode type; |
duke@1 | 512 | }; |
duke@1 | 513 | |
duke@1 | 514 | |
duke@1 | 515 | |
duke@1 | 516 | enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; |
duke@1 | 517 | |
duke@1 | 518 | interface AttributeDef : Contained |
duke@1 | 519 | /** |
duke@1 | 520 | An AttributeDef represents the information that defines an |
duke@1 | 521 | attribute of an interface. |
duke@1 | 522 | */ |
duke@1 | 523 | { |
duke@1 | 524 | readonly attribute TypeCode type; |
duke@1 | 525 | attribute IDLType type_def; |
duke@1 | 526 | attribute AttributeMode mode; |
duke@1 | 527 | }; |
duke@1 | 528 | |
duke@1 | 529 | struct AttributeDescription { |
duke@1 | 530 | Identifier name; |
duke@1 | 531 | RepositoryId id; |
duke@1 | 532 | RepositoryId defined_in; |
duke@1 | 533 | VersionSpec version; |
duke@1 | 534 | TypeCode type; |
duke@1 | 535 | AttributeMode mode; |
duke@1 | 536 | }; |
duke@1 | 537 | |
duke@1 | 538 | |
duke@1 | 539 | |
duke@1 | 540 | enum OperationMode {OP_NORMAL, OP_ONEWAY}; |
duke@1 | 541 | |
duke@1 | 542 | enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; |
duke@1 | 543 | struct ParameterDescription { |
duke@1 | 544 | Identifier name; |
duke@1 | 545 | TypeCode type; |
duke@1 | 546 | IDLType type_def; |
duke@1 | 547 | ParameterMode mode; |
duke@1 | 548 | }; |
duke@1 | 549 | typedef sequence <ParameterDescription> ParDescriptionSeq; |
duke@1 | 550 | |
duke@1 | 551 | typedef Identifier ContextIdentifier; |
duke@1 | 552 | typedef sequence <ContextIdentifier> ContextIdSeq; |
duke@1 | 553 | |
duke@1 | 554 | typedef sequence <ExceptionDef> ExceptionDefSeq; |
duke@1 | 555 | typedef sequence <ExceptionDescription> ExcDescriptionSeq; |
duke@1 | 556 | |
duke@1 | 557 | interface OperationDef : Contained |
duke@1 | 558 | /** |
duke@1 | 559 | An OperationDef represents the information that defines an |
duke@1 | 560 | operation of an interface. |
duke@1 | 561 | */ |
duke@1 | 562 | { |
duke@1 | 563 | readonly attribute TypeCode result; |
duke@1 | 564 | attribute IDLType result_def; |
duke@1 | 565 | attribute ParDescriptionSeq params; |
duke@1 | 566 | attribute OperationMode mode; |
duke@1 | 567 | attribute ContextIdSeq contexts; |
duke@1 | 568 | attribute ExceptionDefSeq exceptions; |
duke@1 | 569 | }; |
duke@1 | 570 | |
duke@1 | 571 | struct OperationDescription { |
duke@1 | 572 | Identifier name; |
duke@1 | 573 | RepositoryId id; |
duke@1 | 574 | RepositoryId defined_in; |
duke@1 | 575 | VersionSpec version; |
duke@1 | 576 | TypeCode result; |
duke@1 | 577 | OperationMode mode; |
duke@1 | 578 | ContextIdSeq contexts; |
duke@1 | 579 | ParDescriptionSeq parameters; |
duke@1 | 580 | ExcDescriptionSeq exceptions; |
duke@1 | 581 | }; |
duke@1 | 582 | |
duke@1 | 583 | |
duke@1 | 584 | |
duke@1 | 585 | typedef sequence <RepositoryId> RepositoryIdSeq; |
duke@1 | 586 | typedef sequence <OperationDescription> OpDescriptionSeq; |
duke@1 | 587 | typedef sequence <AttributeDescription> AttrDescriptionSeq; |
duke@1 | 588 | |
duke@1 | 589 | interface InterfaceDef : Container, Contained, IDLType |
duke@1 | 590 | /** |
duke@1 | 591 | An InterfaceDef object represents an interface definition. It can |
duke@1 | 592 | contains constants, typedefs, exceptions, operations, and |
duke@1 | 593 | attributes. |
duke@1 | 594 | */ |
duke@1 | 595 | { |
duke@1 | 596 | // read/write interface |
duke@1 | 597 | |
duke@1 | 598 | attribute InterfaceDefSeq base_interfaces; |
duke@1 | 599 | attribute boolean is_abstract; |
duke@1 | 600 | |
duke@1 | 601 | // read interface |
duke@1 | 602 | |
duke@1 | 603 | boolean is_a (in RepositoryId interface_id); |
duke@1 | 604 | |
duke@1 | 605 | struct FullInterfaceDescription { |
duke@1 | 606 | Identifier name; |
duke@1 | 607 | RepositoryId id; |
duke@1 | 608 | RepositoryId defined_in; |
duke@1 | 609 | VersionSpec version; |
duke@1 | 610 | boolean is_abstract; |
duke@1 | 611 | OpDescriptionSeq operations; |
duke@1 | 612 | AttrDescriptionSeq attributes; |
duke@1 | 613 | RepositoryIdSeq base_interfaces; |
duke@1 | 614 | TypeCode type; |
duke@1 | 615 | }; |
duke@1 | 616 | |
duke@1 | 617 | FullInterfaceDescription describe_interface(); |
duke@1 | 618 | |
duke@1 | 619 | // write interface |
duke@1 | 620 | |
duke@1 | 621 | AttributeDef create_attribute ( |
duke@1 | 622 | in RepositoryId id, |
duke@1 | 623 | in Identifier name, |
duke@1 | 624 | in VersionSpec version, |
duke@1 | 625 | in IDLType type, |
duke@1 | 626 | in AttributeMode mode |
duke@1 | 627 | ); |
duke@1 | 628 | |
duke@1 | 629 | OperationDef create_operation ( |
duke@1 | 630 | in RepositoryId id, |
duke@1 | 631 | in Identifier name, |
duke@1 | 632 | in VersionSpec version, |
duke@1 | 633 | in IDLType result, |
duke@1 | 634 | in OperationMode mode, |
duke@1 | 635 | in ParDescriptionSeq params, |
duke@1 | 636 | in ExceptionDefSeq exceptions, |
duke@1 | 637 | in ContextIdSeq contexts |
duke@1 | 638 | ); |
duke@1 | 639 | }; |
duke@1 | 640 | |
duke@1 | 641 | struct InterfaceDescription { |
duke@1 | 642 | Identifier name; |
duke@1 | 643 | RepositoryId id; |
duke@1 | 644 | RepositoryId defined_in; |
duke@1 | 645 | VersionSpec version; |
duke@1 | 646 | RepositoryIdSeq base_interfaces; |
duke@1 | 647 | }; |
duke@1 | 648 | |
duke@1 | 649 | |
duke@1 | 650 | // orbos 98-01-18: Objects By Value -- begin |
duke@1 | 651 | |
duke@1 | 652 | interface ValueMemberDef : Contained |
duke@1 | 653 | |
duke@1 | 654 | /** A <code>ValueMemberDef</code> object represents the public |
duke@1 | 655 | and private data member definition of a <code>Value</code> type |
duke@1 | 656 | */ |
duke@1 | 657 | |
duke@1 | 658 | { |
duke@1 | 659 | readonly attribute TypeCode type; |
duke@1 | 660 | attribute IDLType type_def; |
duke@1 | 661 | attribute Visibility access; |
duke@1 | 662 | }; |
duke@1 | 663 | |
duke@1 | 664 | interface ValueDef : Container, Contained, IDLType |
duke@1 | 665 | /** |
duke@1 | 666 | A ValueDef object represents the definition of the |
duke@1 | 667 | <code>Value</code> object used to pass the object state |
duke@1 | 668 | between hosts |
duke@1 | 669 | */ |
duke@1 | 670 | |
duke@1 | 671 | { |
duke@1 | 672 | // read/write interface |
duke@1 | 673 | attribute InterfaceDefSeq supported_interfaces; |
duke@1 | 674 | attribute InitializerSeq initializers; |
duke@1 | 675 | attribute ValueDef base_value; |
duke@1 | 676 | attribute ValueDefSeq abstract_base_values; |
duke@1 | 677 | attribute boolean is_abstract; |
duke@1 | 678 | attribute boolean is_custom; |
duke@1 | 679 | attribute octet flags; // always 0 |
duke@1 | 680 | attribute boolean has_safe_base; |
duke@1 | 681 | |
duke@1 | 682 | // read interface |
duke@1 | 683 | boolean is_a(in RepositoryId value_id); |
duke@1 | 684 | |
duke@1 | 685 | struct FullValueDescription { |
duke@1 | 686 | Identifier name; |
duke@1 | 687 | RepositoryId id; |
duke@1 | 688 | boolean is_abstract; |
duke@1 | 689 | boolean is_custom; |
duke@1 | 690 | octet flags; // always 0 |
duke@1 | 691 | RepositoryId defined_in; |
duke@1 | 692 | VersionSpec version; |
duke@1 | 693 | OpDescriptionSeq operations; |
duke@1 | 694 | AttrDescriptionSeq attributes; |
duke@1 | 695 | ValueMemberSeq members; |
duke@1 | 696 | InitializerSeq initializers; |
duke@1 | 697 | RepositoryIdSeq supported_interfaces; |
duke@1 | 698 | RepositoryIdSeq abstract_base_values; |
duke@1 | 699 | boolean has_safe_base; |
duke@1 | 700 | RepositoryId base_value; |
duke@1 | 701 | TypeCode type; |
duke@1 | 702 | }; |
duke@1 | 703 | |
duke@1 | 704 | FullValueDescription describe_value(); |
duke@1 | 705 | |
duke@1 | 706 | // write interface |
duke@1 | 707 | |
duke@1 | 708 | ValueMemberDef create_value_member( |
duke@1 | 709 | in RepositoryId id, |
duke@1 | 710 | in Identifier name, |
duke@1 | 711 | in VersionSpec version, |
duke@1 | 712 | in IDLType type_def, |
duke@1 | 713 | in Visibility access |
duke@1 | 714 | ); |
duke@1 | 715 | |
duke@1 | 716 | AttributeDef create_attribute( |
duke@1 | 717 | in RepositoryId id, |
duke@1 | 718 | in Identifier name, |
duke@1 | 719 | in VersionSpec version, |
duke@1 | 720 | in IDLType type, |
duke@1 | 721 | in AttributeMode mode |
duke@1 | 722 | ); |
duke@1 | 723 | |
duke@1 | 724 | OperationDef create_operation( |
duke@1 | 725 | in RepositoryId id, |
duke@1 | 726 | in Identifier name, |
duke@1 | 727 | in VersionSpec version, |
duke@1 | 728 | in IDLType result, |
duke@1 | 729 | in OperationMode mode, |
duke@1 | 730 | in ParDescriptionSeq params, |
duke@1 | 731 | in ExceptionDefSeq exceptions, |
duke@1 | 732 | in ContextIdSeq contexts |
duke@1 | 733 | ); |
duke@1 | 734 | }; |
duke@1 | 735 | struct ValueDescription { |
duke@1 | 736 | Identifier name; |
duke@1 | 737 | RepositoryId id; |
duke@1 | 738 | boolean is_abstract; |
duke@1 | 739 | boolean is_custom; |
duke@1 | 740 | octet flags; // always 0 |
duke@1 | 741 | RepositoryId defined_in; |
duke@1 | 742 | VersionSpec version; |
duke@1 | 743 | RepositoryIdSeq supported_interfaces; |
duke@1 | 744 | RepositoryIdSeq abstract_base_values; |
duke@1 | 745 | boolean has_safe_base; |
duke@1 | 746 | RepositoryId base_value; |
duke@1 | 747 | }; |
duke@1 | 748 | |
duke@1 | 749 | interface ValueBoxDef : IDLType |
duke@1 | 750 | |
duke@1 | 751 | /** ValueBoxDef is an interface that reresents a value type with |
duke@1 | 752 | a single data member inside its state section and no |
duke@1 | 753 | inheritance or methods. For example, when transmitting a |
duke@1 | 754 | string or sequence as an actual parameter on an interface |
duke@1 | 755 | operation or as a data member of a value type that is an |
duke@1 | 756 | actual parameter, it may be important to preserve any sharing |
duke@1 | 757 | of the string or sequence within the object graph being |
duke@1 | 758 | transmitted. Because current IDL data types do not preserve |
duke@1 | 759 | referential integrity in this way, this requirement is |
duke@1 | 760 | conveniently handled by using a value type. Value types also |
duke@1 | 761 | support the transmission of nulls (as a distinguished value), |
duke@1 | 762 | whereas IDL data types such as string and sequence (which are |
duke@1 | 763 | mapped to empty strings and sequences) do not. The Java to IDL |
duke@1 | 764 | mapping requires both preservation of referential integrity |
duke@1 | 765 | and transmission of nulls. Because it would be cumbersome to |
duke@1 | 766 | require the full IDL syntax for a value type for this specific |
duke@1 | 767 | usage, this shorthand notation is introduced to cover this use |
duke@1 | 768 | of value types for simple containment of a single data member. |
duke@1 | 769 | */ |
duke@1 | 770 | |
duke@1 | 771 | { |
duke@1 | 772 | attribute IDLType original_type_def; |
duke@1 | 773 | }; |
duke@1 | 774 | |
duke@1 | 775 | // orbos 98-01-18: Objects By Value -- end |
duke@1 | 776 | |
ohair@5 | 777 | enum TCKind { |
ohair@5 | 778 | tk_null, tk_void, |
duke@1 | 779 | tk_short, tk_long, tk_ushort, tk_ulong, |
ohair@5 | 780 | tk_float, tk_double, tk_boolean, tk_char, |
ohair@5 | 781 | tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, |
ohair@5 | 782 | tk_struct, tk_union, tk_enum, tk_string, |
ohair@5 | 783 | tk_sequence, tk_array, tk_alias, tk_except, |
ohair@5 | 784 | tk_longlong, tk_ulonglong, tk_longdouble, |
ohair@5 | 785 | tk_wchar, tk_wstring, tk_fixed, |
ohair@5 | 786 | tk_value, tk_value_box, |
ohair@5 | 787 | tk_native, |
ohair@5 | 788 | tk_abstract_interface |
duke@1 | 789 | }; |
duke@1 | 790 | |
duke@1 | 791 | interface NativeDef : TypedefDef { |
duke@1 | 792 | }; |
duke@1 | 793 | }; |