Fri, 14 Jun 2013 16:31:55 +0100
8011157: Improve CORBA portablility
Summary: fix also reviewed by Alexander Fomin
Reviewed-by: alanb, coffeys, skoivu
duke@1 | 1 | /* |
ohair@158 | 2 | * Copyright (c) 1998, 2007, 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 | * Licensed Materials - Property of IBM |
duke@1 | 28 | * RMI-IIOP v1.0 |
duke@1 | 29 | * Copyright IBM Corp. 1998 1999 All Rights Reserved |
duke@1 | 30 | * |
duke@1 | 31 | */ |
duke@1 | 32 | |
duke@1 | 33 | package sun.rmi.rmic.iiop; |
duke@1 | 34 | |
duke@1 | 35 | import sun.tools.java.Identifier; |
duke@1 | 36 | |
duke@1 | 37 | public interface Constants extends sun.rmi.rmic.Constants { |
duke@1 | 38 | |
duke@1 | 39 | // Identifiers for referenced classes: |
duke@1 | 40 | |
duke@1 | 41 | public static final Identifier idReplyHandler = |
duke@1 | 42 | Identifier.lookup("org.omg.CORBA.portable.ResponseHandler"); |
duke@1 | 43 | public static final Identifier idStubBase = |
duke@1 | 44 | Identifier.lookup("javax.rmi.CORBA.Stub"); |
duke@1 | 45 | public static final Identifier idTieBase = |
duke@1 | 46 | Identifier.lookup("org.omg.CORBA.portable.ObjectImpl"); |
duke@1 | 47 | public static final Identifier idTieInterface = |
duke@1 | 48 | Identifier.lookup("javax.rmi.CORBA.Tie"); |
duke@1 | 49 | public static final Identifier idPOAServantType = |
duke@1 | 50 | Identifier.lookup( "org.omg.PortableServer.Servant" ) ; |
duke@1 | 51 | public static final Identifier idDelegate = |
duke@1 | 52 | Identifier.lookup("org.omg.CORBA.portable.Delegate"); |
duke@1 | 53 | public static final Identifier idOutputStream = |
duke@1 | 54 | Identifier.lookup("org.omg.CORBA.portable.OutputStream"); |
duke@1 | 55 | public static final Identifier idExtOutputStream = |
duke@1 | 56 | Identifier.lookup("org.omg.CORBA_2_3.portable.OutputStream"); |
duke@1 | 57 | public static final Identifier idInputStream = |
duke@1 | 58 | Identifier.lookup("org.omg.CORBA.portable.InputStream"); |
duke@1 | 59 | public static final Identifier idExtInputStream = |
duke@1 | 60 | Identifier.lookup("org.omg.CORBA_2_3.portable.InputStream"); |
duke@1 | 61 | public static final Identifier idSystemException = |
duke@1 | 62 | Identifier.lookup("org.omg.CORBA.SystemException"); |
duke@1 | 63 | public static final Identifier idBadMethodException = |
duke@1 | 64 | Identifier.lookup("org.omg.CORBA.BAD_OPERATION"); |
duke@1 | 65 | public static final Identifier idPortableUnknownException = |
duke@1 | 66 | Identifier.lookup("org.omg.CORBA.portable.UnknownException"); |
duke@1 | 67 | public static final Identifier idApplicationException = |
duke@1 | 68 | Identifier.lookup("org.omg.CORBA.portable.ApplicationException"); |
duke@1 | 69 | public static final Identifier idRemarshalException = |
duke@1 | 70 | Identifier.lookup("org.omg.CORBA.portable.RemarshalException"); |
duke@1 | 71 | public static final Identifier idJavaIoExternalizable = |
duke@1 | 72 | Identifier.lookup("java.io.Externalizable"); |
duke@1 | 73 | public static final Identifier idCorbaObject = |
duke@1 | 74 | Identifier.lookup("org.omg.CORBA.Object"); |
duke@1 | 75 | public static final Identifier idCorbaORB = |
duke@1 | 76 | Identifier.lookup("org.omg.CORBA.ORB"); |
duke@1 | 77 | public static final Identifier idClassDesc = |
duke@1 | 78 | Identifier.lookup("javax.rmi.CORBA.ClassDesc"); |
duke@1 | 79 | public static final Identifier idJavaIoIOException = |
duke@1 | 80 | Identifier.lookup("java.io.IOException"); |
duke@1 | 81 | public static final Identifier idIDLEntity = |
duke@1 | 82 | Identifier.lookup("org.omg.CORBA.portable.IDLEntity"); |
duke@1 | 83 | public static final Identifier idValueBase = |
duke@1 | 84 | Identifier.lookup("org.omg.CORBA.portable.ValueBase"); |
duke@1 | 85 | public static final Identifier idBoxedRMI = |
duke@1 | 86 | Identifier.lookup("org.omg.boxedRMI"); |
duke@1 | 87 | public static final Identifier idBoxedIDL = |
duke@1 | 88 | Identifier.lookup("org.omg.boxedIDL"); |
duke@1 | 89 | public static final Identifier idCorbaUserException = |
duke@1 | 90 | Identifier.lookup("org.omg.CORBA.UserException"); |
duke@1 | 91 | |
duke@1 | 92 | |
duke@1 | 93 | // Identifiers for primitive types: |
duke@1 | 94 | |
duke@1 | 95 | public static final Identifier idBoolean = |
duke@1 | 96 | Identifier.lookup("boolean"); |
duke@1 | 97 | public static final Identifier idByte = |
duke@1 | 98 | Identifier.lookup("byte"); |
duke@1 | 99 | public static final Identifier idChar = |
duke@1 | 100 | Identifier.lookup("char"); |
duke@1 | 101 | public static final Identifier idShort = |
duke@1 | 102 | Identifier.lookup("short"); |
duke@1 | 103 | public static final Identifier idInt = |
duke@1 | 104 | Identifier.lookup("int"); |
duke@1 | 105 | public static final Identifier idLong = |
duke@1 | 106 | Identifier.lookup("long"); |
duke@1 | 107 | public static final Identifier idFloat = |
duke@1 | 108 | Identifier.lookup("float"); |
duke@1 | 109 | public static final Identifier idDouble = |
duke@1 | 110 | Identifier.lookup("double"); |
duke@1 | 111 | public static final Identifier idVoid = |
duke@1 | 112 | Identifier.lookup("void"); |
duke@1 | 113 | |
duke@1 | 114 | // IndentingWriter constructor args: |
duke@1 | 115 | |
duke@1 | 116 | public static final int INDENT_STEP = 4; |
duke@1 | 117 | public static final int TAB_SIZE = Integer.MAX_VALUE; // No tabs. |
duke@1 | 118 | |
duke@1 | 119 | // Type status codes: |
duke@1 | 120 | |
duke@1 | 121 | public static final int STATUS_PENDING = 0; |
duke@1 | 122 | public static final int STATUS_VALID = 1; |
duke@1 | 123 | public static final int STATUS_INVALID = 2; |
duke@1 | 124 | |
duke@1 | 125 | // Java Names: |
duke@1 | 126 | |
duke@1 | 127 | public static final String NAME_SEPARATOR = "."; |
duke@1 | 128 | public static final String SERIAL_VERSION_UID = "serialVersionUID"; |
duke@1 | 129 | |
duke@1 | 130 | // IDL Names: |
duke@1 | 131 | |
duke@1 | 132 | public static final String[] IDL_KEYWORDS = { |
duke@1 | 133 | "abstract", |
duke@1 | 134 | "any", |
duke@1 | 135 | "attribute", |
duke@1 | 136 | "boolean", |
duke@1 | 137 | "case", |
duke@1 | 138 | "char", |
duke@1 | 139 | "const", |
duke@1 | 140 | "context", |
duke@1 | 141 | "custom", |
duke@1 | 142 | "default", |
duke@1 | 143 | "double", |
duke@1 | 144 | "enum", |
duke@1 | 145 | "exception", |
duke@1 | 146 | "factory", |
duke@1 | 147 | "FALSE", |
duke@1 | 148 | "fixed", |
duke@1 | 149 | "float", |
duke@1 | 150 | "in", |
duke@1 | 151 | "inout", |
duke@1 | 152 | "interface", |
duke@1 | 153 | "long", |
duke@1 | 154 | "module", |
duke@1 | 155 | "native", |
duke@1 | 156 | "Object", |
duke@1 | 157 | "octet", |
duke@1 | 158 | "oneway", |
duke@1 | 159 | "out", |
duke@1 | 160 | "private", |
duke@1 | 161 | "public", |
duke@1 | 162 | "raises", |
duke@1 | 163 | "readonly", |
duke@1 | 164 | "sequence", |
duke@1 | 165 | "short", |
duke@1 | 166 | "string", |
duke@1 | 167 | "struct", |
duke@1 | 168 | "supports", |
duke@1 | 169 | "switch", |
duke@1 | 170 | "TRUE", |
duke@1 | 171 | "truncatable", |
duke@1 | 172 | "typedef", |
duke@1 | 173 | "unsigned", |
duke@1 | 174 | "union", |
duke@1 | 175 | "ValueBase", |
duke@1 | 176 | "valuetype", |
duke@1 | 177 | "void", |
duke@1 | 178 | "wchar", |
duke@1 | 179 | "wstring", |
duke@1 | 180 | }; |
duke@1 | 181 | |
duke@1 | 182 | |
duke@1 | 183 | public static final String EXCEPTION_SUFFIX = "Exception"; |
duke@1 | 184 | public static final String ERROR_SUFFIX = "Error"; |
duke@1 | 185 | public static final String EX_SUFFIX = "Ex"; |
duke@1 | 186 | |
duke@1 | 187 | public static final String IDL_REPOSITORY_ID_PREFIX = "IDL:"; |
duke@1 | 188 | public static final String IDL_REPOSITORY_ID_VERSION = ":1.0"; |
duke@1 | 189 | |
duke@1 | 190 | public static final String[] IDL_CORBA_MODULE = {"CORBA"}; |
duke@1 | 191 | public static final String[] IDL_SEQUENCE_MODULE = {"org","omg","boxedRMI"}; |
duke@1 | 192 | public static final String[] IDL_BOXEDIDL_MODULE = {"org","omg","boxedIDL"}; |
duke@1 | 193 | |
duke@1 | 194 | public static final String IDL_CLASS = "ClassDesc"; |
duke@1 | 195 | public static final String[] IDL_CLASS_MODULE = {"javax","rmi","CORBA"}; |
duke@1 | 196 | |
duke@1 | 197 | public static final String IDL_IDLENTITY = "IDLEntity"; |
duke@1 | 198 | public static final String IDL_SERIALIZABLE = "Serializable"; |
duke@1 | 199 | public static final String IDL_EXTERNALIZABLE = "Externalizable"; |
duke@1 | 200 | public static final String[] IDL_JAVA_IO_MODULE = {"java","io"}; |
duke@1 | 201 | public static final String[] IDL_ORG_OMG_CORBA_MODULE = {"org","omg","CORBA"}; |
duke@1 | 202 | public static final String[] IDL_ORG_OMG_CORBA_PORTABLE_MODULE = {"org","omg","CORBA","portable"}; |
duke@1 | 203 | |
duke@1 | 204 | public static final String IDL_JAVA_LANG_OBJECT = "_Object"; |
duke@1 | 205 | public static final String[] IDL_JAVA_LANG_MODULE = {"java","lang"}; |
duke@1 | 206 | |
duke@1 | 207 | public static final String IDL_JAVA_RMI_REMOTE = "Remote"; |
duke@1 | 208 | public static final String[] IDL_JAVA_RMI_MODULE = {"java","rmi"}; |
duke@1 | 209 | |
duke@1 | 210 | public static final String IDL_SEQUENCE = "seq"; |
duke@1 | 211 | |
duke@1 | 212 | public static final String IDL_CONSTRUCTOR = "create"; |
duke@1 | 213 | |
duke@1 | 214 | public static final String IDL_NAME_SEPARATOR = "::"; |
duke@1 | 215 | public static final String IDL_BOOLEAN = "boolean"; |
duke@1 | 216 | public static final String IDL_BYTE = "octet"; |
duke@1 | 217 | public static final String IDL_CHAR = "wchar"; |
duke@1 | 218 | public static final String IDL_SHORT = "short"; |
duke@1 | 219 | public static final String IDL_INT = "long"; |
duke@1 | 220 | public static final String IDL_LONG = "long long"; |
duke@1 | 221 | public static final String IDL_FLOAT = "float"; |
duke@1 | 222 | public static final String IDL_DOUBLE = "double"; |
duke@1 | 223 | public static final String IDL_VOID = "void"; |
duke@1 | 224 | |
duke@1 | 225 | public static final String IDL_STRING = "WStringValue"; |
duke@1 | 226 | public static final String IDL_CONSTANT_STRING = "wstring"; |
duke@1 | 227 | public static final String IDL_CORBA_OBJECT = "Object"; |
duke@1 | 228 | public static final String IDL_ANY = "any"; |
duke@1 | 229 | |
duke@1 | 230 | // File names: |
duke@1 | 231 | |
duke@1 | 232 | public static final String SOURCE_FILE_EXTENSION = ".java"; |
duke@1 | 233 | public static final String IDL_FILE_EXTENSION = ".idl"; |
duke@1 | 234 | |
duke@1 | 235 | // Type Codes: |
duke@1 | 236 | |
duke@1 | 237 | public static final int TYPE_VOID = 0x00000001; // In PrimitiveType |
duke@1 | 238 | public static final int TYPE_BOOLEAN = 0x00000002; // In PrimitiveType |
duke@1 | 239 | public static final int TYPE_BYTE = 0x00000004; // In PrimitiveType |
duke@1 | 240 | public static final int TYPE_CHAR = 0x00000008; // In PrimitiveType |
duke@1 | 241 | public static final int TYPE_SHORT = 0x00000010; // In PrimitiveType |
duke@1 | 242 | public static final int TYPE_INT = 0x00000020; // In PrimitiveType |
duke@1 | 243 | public static final int TYPE_LONG = 0x00000040; // In PrimitiveType |
duke@1 | 244 | public static final int TYPE_FLOAT = 0x00000080; // In PrimitiveType |
duke@1 | 245 | public static final int TYPE_DOUBLE = 0x00000100; // In PrimitiveType |
duke@1 | 246 | |
duke@1 | 247 | public static final int TYPE_STRING = 0x00000200; // In SpecialClassType (String) |
duke@1 | 248 | public static final int TYPE_ANY = 0x00000400; // In SpecialInterfaceType (Serializable,Externalizable) |
duke@1 | 249 | public static final int TYPE_CORBA_OBJECT = 0x00000800; // In SpecialInterfaceType (CORBA.Object,Remote) |
duke@1 | 250 | |
duke@1 | 251 | public static final int TYPE_REMOTE = 0x00001000; // In RemoteType |
duke@1 | 252 | public static final int TYPE_ABSTRACT = 0x00002000; // In AbstractType |
duke@1 | 253 | public static final int TYPE_NC_INTERFACE = 0x00004000; // In NCInterfaceType |
duke@1 | 254 | |
duke@1 | 255 | public static final int TYPE_VALUE = 0x00008000; // In ValueType |
duke@1 | 256 | public static final int TYPE_IMPLEMENTATION = 0x00010000; // In ImplementationType |
duke@1 | 257 | public static final int TYPE_NC_CLASS = 0x00020000; // In NCClassType |
duke@1 | 258 | |
duke@1 | 259 | public static final int TYPE_ARRAY = 0x00040000; // In ArrayType |
duke@1 | 260 | public static final int TYPE_JAVA_RMI_REMOTE = 0x00080000; // In SpecialInterfaceType |
duke@1 | 261 | |
duke@1 | 262 | // Type code masks: |
duke@1 | 263 | |
duke@1 | 264 | public static final int TYPE_NONE = 0x00000000; |
duke@1 | 265 | public static final int TYPE_ALL = 0xFFFFFFFF; |
duke@1 | 266 | public static final int TYPE_MASK = 0x00FFFFFF; |
duke@1 | 267 | public static final int TM_MASK = 0xFF000000; |
duke@1 | 268 | |
duke@1 | 269 | // Type code modifiers: |
duke@1 | 270 | |
duke@1 | 271 | public static final int TM_PRIMITIVE = 0x01000000; |
duke@1 | 272 | public static final int TM_COMPOUND = 0x02000000; |
duke@1 | 273 | public static final int TM_CLASS = 0x04000000; |
duke@1 | 274 | public static final int TM_INTERFACE = 0x08000000; |
duke@1 | 275 | public static final int TM_SPECIAL_CLASS = 0x10000000; |
duke@1 | 276 | public static final int TM_SPECIAL_INTERFACE= 0x20000000; |
duke@1 | 277 | public static final int TM_NON_CONFORMING = 0x40000000; |
duke@1 | 278 | public static final int TM_INNER = 0x80000000; |
duke@1 | 279 | |
duke@1 | 280 | // Attribute kinds... |
duke@1 | 281 | |
duke@1 | 282 | public static final int ATTRIBUTE_NONE = 0; // Not an attribute. |
duke@1 | 283 | public static final int ATTRIBUTE_IS = 1; // read-only, had "is" prefix. |
duke@1 | 284 | public static final int ATTRIBUTE_GET = 2; // read-only, had "get" prefix. |
duke@1 | 285 | public static final int ATTRIBUTE_IS_RW = 3; // read-write, had "is" prefix. |
duke@1 | 286 | public static final int ATTRIBUTE_GET_RW = 4; // read-write, had "get" prefix. |
duke@1 | 287 | public static final int ATTRIBUTE_SET = 5; // had "set" prefix. |
duke@1 | 288 | |
duke@1 | 289 | public static final String[] ATTRIBUTE_WIRE_PREFIX = { |
duke@1 | 290 | "", |
duke@1 | 291 | "_get_", |
duke@1 | 292 | "_get_", |
duke@1 | 293 | "_get_", |
duke@1 | 294 | "_get_", |
duke@1 | 295 | "_set_", |
duke@1 | 296 | }; |
duke@1 | 297 | } |