1. /*
  2. * @(#)ORBConstants.java 1.69 03/08/21
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.orbutil;
  8. import com.sun.corba.se.impl.util.SUNVMCID ;
  9. public class ORBConstants {
  10. private ORBConstants() {}
  11. public static final String STRINGIFY_PREFIX = "IOR:" ;
  12. /* TAGS
  13. tag-request@omg.org
  14. FAQ on tags and tag allocation: http://doc.omg.org/ptc/99-02-01.
  15. http://doc.omg.org/standard-tags
  16. http://doc.omg.org/vendor-tags
  17. Last update: 19th August 2003 (ptc/03-08-14)
  18. // Legacy
  19. 1 profile tag 0x4f4e4300 ("ONC\x00")
  20. 1 profile tag 0x4e454f00 ("NEO\x00")
  21. 1 profile tag 0x434f4f4c ("COOL")
  22. 16 service tags 0x4e454f00 - 0x4e454f0f ("NEO\x00" - "NEO\x0f")
  23. // Current
  24. 16 VMCID 0x5355xxxx ("SU\x00\x00" - "SU\xff\xff")
  25. 16 profile tags 0x53554e00 - 0x53554e0f ("SUN\x00" - "SUN\x0f")
  26. 16 ORB Type IDs 0x53554e00 - 0x53554e0f ("SUN\x00" - "SUN\x0f")
  27. 64 service tags 0x53554e00 - 0x53554e3f ("SUN\x00" - "SUN\x3f")
  28. 64 component tags 0x53554e00 - 0x53554e3f ("SUN\x00" - "SUN\x3f")
  29. */
  30. // All NEO service contexts must be in the range
  31. // NEO_FIRST_SERVICE_CONTEXT to
  32. // NEO_FIRST_SERVICE_CONTEXT + NUM_NEO_SERVICE_CONTEXTS - 1
  33. public static final int NEO_FIRST_SERVICE_CONTEXT = 0x4e454f00 ;
  34. public static final int NUM_NEO_SERVICE_CONTEXTS = 15 ;
  35. public static final int TAG_ORB_VERSION = NEO_FIRST_SERVICE_CONTEXT ;
  36. public static final int SUN_TAGGED_COMPONENT_ID_BASE = 0x53554e00;
  37. public static final int SUN_SERVICE_CONTEXT_ID_BASE = 0x53554e00;
  38. //
  39. // Tagged Components Ids
  40. //
  41. // Used by AS 7 for IIOP failover.
  42. public static final int TAG_CONTAINER_ID =
  43. SUN_TAGGED_COMPONENT_ID_BASE + 0;
  44. // Used by AS 8.1 for Request Partioning
  45. public static final int TAG_REQUEST_PARTITIONING_ID =
  46. SUN_TAGGED_COMPONENT_ID_BASE + 1;
  47. // TaggedComponentId for Java serialization tagged component.
  48. public static final int TAG_JAVA_SERIALIZATION_ID =
  49. SUN_TAGGED_COMPONENT_ID_BASE + 2;
  50. //
  51. // Service Context Ids
  52. //
  53. // Used by AS 7 for IIOP failover.
  54. public static final int CONTAINER_ID_SERVICE_CONTEXT =
  55. SUN_SERVICE_CONTEXT_ID_BASE + 0;
  56. // All Sun policies are allocated using the SUNVMCID, which is also
  57. // used for minor codes. This allows 12 bits of offset, so
  58. // the largest legal Sun policy is SUNVMCID.value + 4095.
  59. public static final int SERVANT_CACHING_POLICY = SUNVMCID.value + 0 ;
  60. public static final int ZERO_PORT_POLICY = SUNVMCID.value + 1 ;
  61. public static final int COPY_OBJECT_POLICY = SUNVMCID.value + 2 ;
  62. public static final int REQUEST_PARTITIONING_POLICY = SUNVMCID.value + 3 ;
  63. // These are the subcontract IDs for various qualities of
  64. // service/implementation.
  65. // Persistent SCIDs have the second bit as 1.
  66. // SCIDs less than FIRST_POA_SCID are JavaIDL SCIDs.
  67. public static final int TOA_SCID = 2 ;
  68. public static final int DEFAULT_SCID = TOA_SCID ;
  69. public static final int FIRST_POA_SCID = 32;
  70. public static final int MAX_POA_SCID = 63;
  71. public static final int TRANSIENT_SCID = FIRST_POA_SCID ;
  72. public static final int PERSISTENT_SCID = makePersistent( TRANSIENT_SCID ) ;
  73. public static final int SC_TRANSIENT_SCID = FIRST_POA_SCID + 4 ;
  74. public static final int SC_PERSISTENT_SCID = makePersistent( SC_TRANSIENT_SCID ) ;
  75. public static final int IISC_TRANSIENT_SCID = FIRST_POA_SCID + 8 ;
  76. public static final int IISC_PERSISTENT_SCID = makePersistent( IISC_TRANSIENT_SCID ) ;
  77. public static final int MINSC_TRANSIENT_SCID = FIRST_POA_SCID + 12 ;
  78. public static final int MINSC_PERSISTENT_SCID = makePersistent( MINSC_TRANSIENT_SCID ) ;
  79. public static boolean isTransient( int scid )
  80. {
  81. return (scid & 2) == 0 ;
  82. }
  83. public static int makePersistent( int scid )
  84. {
  85. return scid | 2 ;
  86. }
  87. // Constants for ORB properties **************************************************************
  88. // All ORB properties must follow the following rules:
  89. // 1. Property names must start with either
  90. // ORG_OMG_CORBA_PREFIX or SUN_PREFIX.
  91. // 2. Property names must have unique suffixes after the last ".".
  92. // 3. Property names must have "ORB" as the first 3 letters
  93. // in their suffix.
  94. // 4. proprietary property names should have a subsystem
  95. // where appropriate after the prefix.
  96. // org.omg.CORBA properties must be defined by OMG standards
  97. // The well known org.omg.CORBA.ORBClass and
  98. // org.omg.CORBA.ORBSingletonClass are not included here
  99. // since they occur in org.omg.CORBA.ORB.
  100. public static final String ORG_OMG_PREFIX = "org.omg." ;
  101. public static final String ORG_OMG_CORBA_PREFIX = "org.omg.CORBA." ;
  102. public static final String INITIAL_HOST_PROPERTY =
  103. ORG_OMG_CORBA_PREFIX + "ORBInitialHost" ;
  104. public static final String INITIAL_PORT_PROPERTY =
  105. ORG_OMG_CORBA_PREFIX + "ORBInitialPort" ;
  106. public static final String INITIAL_SERVICES_PROPERTY =
  107. ORG_OMG_CORBA_PREFIX + "ORBInitialServices" ;
  108. public static final String DEFAULT_INIT_REF_PROPERTY =
  109. ORG_OMG_CORBA_PREFIX + "ORBDefaultInitRef" ;
  110. public static final String ORB_INIT_REF_PROPERTY =
  111. ORG_OMG_CORBA_PREFIX + "ORBInitRef" ;
  112. // All of our proprietary properties must start with com.sun.CORBA
  113. public static final String SUN_PREFIX = "com.sun.CORBA." ;
  114. // general properties
  115. public static final String ALLOW_LOCAL_OPTIMIZATION = SUN_PREFIX + "ORBAllowLocalOptimization" ;
  116. public static final String SERVER_PORT_PROPERTY = SUN_PREFIX + "ORBServerPort" ;
  117. public static final String SERVER_HOST_PROPERTY = SUN_PREFIX + "ORBServerHost" ;
  118. public static final String ORB_ID_PROPERTY = ORG_OMG_CORBA_PREFIX + "ORBId" ;
  119. // This property is provided for backward compatibility reasons
  120. public static final String OLD_ORB_ID_PROPERTY = SUN_PREFIX + "ORBid" ;
  121. public static final String ORB_SERVER_ID_PROPERTY = ORG_OMG_CORBA_PREFIX + "ORBServerId" ;
  122. public static final String DEBUG_PROPERTY = SUN_PREFIX + "ORBDebug" ;
  123. // NOTE: This is an internal property. It should never be set by
  124. // a user. That is the reason it has spaces in its name - to make it
  125. // harder to use.
  126. public static final String LISTEN_ON_ALL_INTERFACES = SUN_PREFIX + "INTERNAL USE ONLY: listen on all interfaces";
  127. // giop related properties - default settings in decimal form
  128. public static final String GIOP_VERSION = SUN_PREFIX + "giop.ORBGIOPVersion" ;
  129. public static final String GIOP_FRAGMENT_SIZE = SUN_PREFIX + "giop.ORBFragmentSize" ;
  130. public static final String GIOP_BUFFER_SIZE = SUN_PREFIX + "giop.ORBBufferSize" ;
  131. public static final String GIOP_11_BUFFMGR = SUN_PREFIX + "giop.ORBGIOP11BuffMgr";
  132. public static final String GIOP_12_BUFFMGR = SUN_PREFIX + "giop.ORBGIOP12BuffMgr";
  133. public static final String GIOP_TARGET_ADDRESSING = SUN_PREFIX + "giop.ORBTargetAddressing";
  134. public static final int GIOP_DEFAULT_FRAGMENT_SIZE = 1024;
  135. public static final int GIOP_DEFAULT_BUFFER_SIZE = 1024;
  136. public static final int DEFAULT_GIOP_11_BUFFMGR = 0; //Growing
  137. public static final int DEFAULT_GIOP_12_BUFFMGR = 2; //Streaming
  138. public static final short ADDR_DISP_OBJKEY = 0; // object key used for target addressing
  139. public static final short ADDR_DISP_PROFILE = 1; // iop profile used for target addressing
  140. public static final short ADDR_DISP_IOR = 2; // ior used for target addressing
  141. public static final short ADDR_DISP_HANDLE_ALL = 3; // accept all target addressing dispositions (default)
  142. // CORBA formal 00-11-03 sections 15.4.2.2, 15.4.3.2, 15.4.6.2
  143. // state that the GIOP 1.2 RequestMessage, ReplyMessage, and
  144. // LocateReply message bodies must begin on 8 byte boundaries.
  145. public static final int GIOP_12_MSG_BODY_ALIGNMENT = 8;
  146. // The GIOP 1.2 fragments must be divisible by 8. We generalize this
  147. // to GIOP 1.1 fragments, as well.
  148. public static final int GIOP_FRAGMENT_DIVISOR = 8;
  149. public static final int GIOP_FRAGMENT_MINIMUM_SIZE = 32;
  150. // connection management properties
  151. public static final String HIGH_WATER_MARK_PROPERTY =
  152. SUN_PREFIX + "connection.ORBHighWaterMark" ;
  153. public static final String LOW_WATER_MARK_PROPERTY =
  154. SUN_PREFIX + "connection.ORBLowWaterMark" ;
  155. public static final String NUMBER_TO_RECLAIM_PROPERTY =
  156. SUN_PREFIX + "connection.ORBNumberToReclaim" ;
  157. public static final String ACCEPTOR_CLASS_PREFIX_PROPERTY =
  158. SUN_PREFIX + "transport.ORBAcceptor";
  159. public static final String CONTACT_INFO_LIST_FACTORY_CLASS_PROPERTY =
  160. SUN_PREFIX + "transport.ORBContactInfoList";
  161. // Legacy:
  162. public static final String LEGACY_SOCKET_FACTORY_CLASS_PROPERTY =
  163. SUN_PREFIX + "legacy.connection.ORBSocketFactoryClass" ;
  164. public static final String SOCKET_FACTORY_CLASS_PROPERTY =
  165. SUN_PREFIX + "transport.ORBSocketFactoryClass" ;
  166. public static final String LISTEN_SOCKET_PROPERTY =
  167. SUN_PREFIX + "transport.ORBListenSocket";
  168. public static final String IOR_TO_SOCKET_INFO_CLASS_PROPERTY =
  169. SUN_PREFIX + "transport.ORBIORToSocketInfoClass";
  170. public static final String IIOP_PRIMARY_TO_CONTACT_INFO_CLASS_PROPERTY =
  171. SUN_PREFIX + "transport.ORBIIOPPrimaryToContactInfoClass";
  172. // Request partitioning maximum and minimum thread pool id constants.
  173. public static final int REQUEST_PARTITIONING_MIN_THREAD_POOL_ID = 0;
  174. public static final int REQUEST_PARTITIONING_MAX_THREAD_POOL_ID = 63;
  175. // transport read tcp timeout property, colon separated property
  176. // with syntax <initial time to wait:max read giop header time to
  177. // wait: max read message time to wait:backoff factor>
  178. public static final String TRANSPORT_TCP_READ_TIMEOUTS_PROPERTY =
  179. SUN_PREFIX + "transport.ORBTCPReadTimeouts";
  180. // initial time to wait in milliseconds if a transport
  181. // tcp read returns 0 bytes
  182. public static final int TRANSPORT_TCP_INITIAL_TIME_TO_WAIT = 100;
  183. // max time to spend in cumulative waits in milliseconds
  184. // if a transport tcp read returns 0 bytes
  185. public static final int TRANSPORT_TCP_MAX_TIME_TO_WAIT = 3000;
  186. // max time to spend in cumulative waits in milliseconds
  187. // if a transport tcp read of GIOP header returns 0 bytes
  188. public static final int TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT = 300;
  189. // A backoff percentage used to compute the next amount of time to
  190. // wait on a subsequent transport tcp read of 0 bytes
  191. public static final int TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR = 20;
  192. public static final String USE_NIO_SELECT_TO_WAIT_PROPERTY =
  193. SUN_PREFIX + "transport.ORBUseNIOSelectToWait";
  194. // "Socket" | "SocketChannel"
  195. // Note: Connections accepted by SocketChannel will be SocketChannel.
  196. public static final String ACCEPTOR_SOCKET_TYPE_PROPERTY =
  197. SUN_PREFIX + "transport.ORBAcceptorSocketType";
  198. // Applicable if using SocketChannel and using select thread.
  199. public static final String ACCEPTOR_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY =
  200. SUN_PREFIX + "transport.ORBAcceptorSocketUseWorkerThreadForEvent";
  201. // Applicable on client-side. "Socket" | "SocketChannel"
  202. public static final String CONNECTION_SOCKET_TYPE_PROPERTY =
  203. SUN_PREFIX + "transport.ORBConnectionSocketType";
  204. // Applicable if using SocketChannel and using select thread
  205. public static final String CONNECTION_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY =
  206. SUN_PREFIX + "transport.ORBConnectionSocketUseWorkerThreadForEvent";
  207. // Used to disable the use of direct byte buffers. This enables much easier
  208. // debugging, because the contents of a direct byte buffer cannot be
  209. // viewed in most (all?) debuggers.
  210. public static final String DISABLE_DIRECT_BYTE_BUFFER_USE_PROPERTY =
  211. SUN_PREFIX + "transport.ORBDisableDirectByteBufferUse" ;
  212. public static final String SOCKET = "Socket";
  213. public static final String SOCKETCHANNEL = "SocketChannel";
  214. // POA related policies
  215. public static final String PERSISTENT_SERVER_PORT_PROPERTY = SUN_PREFIX + "POA.ORBPersistentServerPort" ;
  216. public static final String SERVER_ID_PROPERTY = SUN_PREFIX + "POA.ORBServerId" ;
  217. public static final String BAD_SERVER_ID_HANDLER_CLASS_PROPERTY
  218. = SUN_PREFIX + "POA.ORBBadServerIdHandlerClass" ;
  219. public static final String ACTIVATED_PROPERTY = SUN_PREFIX + "POA.ORBActivated" ;
  220. public static final String SERVER_NAME_PROPERTY = SUN_PREFIX + "POA.ORBServerName" ;
  221. // Server Properties; e.g. when properties passed to ORB activated
  222. // servers
  223. public static final String SERVER_DEF_VERIFY_PROPERTY = SUN_PREFIX + "activation.ORBServerVerify" ;
  224. // This one is an exception, but it may be externally visible
  225. public static final String SUN_LC_PREFIX = "com.sun.corba." ;
  226. // Necessary for package renaming to work correctly
  227. public static final String SUN_LC_VERSION_PREFIX = "com.sun.corba.se.";
  228. public static final String JTS_CLASS_PROPERTY = SUN_LC_VERSION_PREFIX + "CosTransactions.ORBJTSClass" ;
  229. // Property for enabling ORB's use of Java serialization.
  230. public static final String ENABLE_JAVA_SERIALIZATION_PROPERTY =
  231. SUN_PREFIX + "encoding.ORBEnableJavaSerialization";
  232. // Constants for ORB prefixes **************************************************************
  233. public static final String PI_ORB_INITIALIZER_CLASS_PREFIX =
  234. "org.omg.PortableInterceptor.ORBInitializerClass.";
  235. public static final String USE_DYNAMIC_STUB_PROPERTY = SUN_PREFIX + "ORBUseDynamicStub" ;
  236. public static final String DYNAMIC_STUB_FACTORY_FACTORY_CLASS =
  237. SUN_PREFIX + "ORBDynamicStubFactoryFactoryClass" ;
  238. // Constants for NameService properties ************************************
  239. public static final int DEFAULT_INITIAL_PORT = 900;
  240. public static final int DEFAULT_INS_PORT = 2089;
  241. public static final int DEFAULT_INS_GIOP_MAJOR_VERSION = 1;
  242. public static final int DEFAULT_INS_GIOP_MINOR_VERSION = 2;
  243. // Constants for INS properties ********************************************
  244. // GIOP Version number for validation of INS URL format addresses
  245. public static final int MAJORNUMBER_SUPPORTED = 1;
  246. public static final int MINORNUMBERMAX = 2;
  247. // Subcontract's differentiation using the TRANSIENT and PERSISTENT
  248. // Name Service Property.
  249. public static final int TRANSIENT = 1;
  250. public static final int PERSISTENT = 2;
  251. // Constants for ORBD properties ****************************************************************
  252. // These properties are never passed on ORB init: they are only passed to ORBD.
  253. public static final String DB_DIR_PROPERTY = SUN_PREFIX + "activation.DbDir" ;
  254. public static final String DB_PROPERTY = SUN_PREFIX + "activation.db" ;
  255. public static final String ORBD_PORT_PROPERTY = SUN_PREFIX + "activation.Port" ;
  256. public static final String SERVER_POLLING_TIME = SUN_PREFIX + "activation.ServerPollingTime";
  257. public static final String SERVER_STARTUP_DELAY = SUN_PREFIX + "activation.ServerStartupDelay";
  258. public static final int DEFAULT_ACTIVATION_PORT = 1049 ;
  259. // If RI is starting the NameService then they would indicate that by
  260. // passing the RI flag. That would start a Persistent Port to listen to
  261. // INS request.
  262. public static final int RI_NAMESERVICE_PORT = 1050;
  263. public static final int DEFAULT_SERVER_POLLING_TIME = 1000;
  264. public static final int DEFAULT_SERVER_STARTUP_DELAY = 1000;
  265. //***************** Constants for Logging ****************
  266. public static final String LOG_LEVEL_PROPERTY = SUN_PREFIX + "ORBLogLevel";
  267. public static final String LOG_RESOURCE_FILE =
  268. "com.sun.corba.se.impl.logging.LogStrings";
  269. // Constants for initial references *************************************************************
  270. public static final String TRANSIENT_NAME_SERVICE_NAME = "TNameService" ;
  271. public static final String PERSISTENT_NAME_SERVICE_NAME = "NameService" ;
  272. // A large Number to make sure that other ServerIds doesn't collide
  273. // with NameServer Persistent Server Id
  274. public static final String NAME_SERVICE_SERVER_ID = "1000000" ;
  275. public static final String ROOT_POA_NAME = "RootPOA" ;
  276. public static final String POA_CURRENT_NAME = "POACurrent" ;
  277. public static final String SERVER_ACTIVATOR_NAME = "ServerActivator" ;
  278. public static final String SERVER_LOCATOR_NAME = "ServerLocator" ;
  279. public static final String SERVER_REPOSITORY_NAME = "ServerRepository" ;
  280. public static final String INITIAL_NAME_SERVICE_NAME= "InitialNameService" ;
  281. public static final String TRANSACTION_CURRENT_NAME = "TransactionCurrent" ;
  282. public static final String DYN_ANY_FACTORY_NAME = "DynAnyFactory" ;
  283. // New for Portable Interceptors
  284. public static final String PI_CURRENT_NAME = "PICurrent" ;
  285. public static final String CODEC_FACTORY_NAME = "CodecFactory" ;
  286. // Constants for ORBD DB ***********************************************************************
  287. public static final String DEFAULT_DB_DIR = "orb.db" ;
  288. public static final String DEFAULT_DB_NAME = "db" ;
  289. public static final String INITIAL_ORB_DB = "initial.db" ;
  290. public static final String SERVER_LOG_DIR = "logs" ;
  291. public static final String ORBID_DIR_BASE = "orbids" ;
  292. public static final String ORBID_DB_FILE_NAME = "orbids.db" ;
  293. // Constants for ThreadPool ********************************************************************
  294. // Default value for when inactive threads in the pool can stop running (ms)
  295. public static final int DEFAULT_INACTIVITY_TIMEOUT = 120000;
  296. // Default name of the threadpool
  297. public static final String THREADPOOL_DEFAULT_NAME = "default-threadpool";
  298. // Default name of the workqueue
  299. public static final String WORKQUEUE_DEFAULT_NAME = "default-workqueue";
  300. // Constants for minor code bases **************************************************************
  301. // This is the value that pre-Merlin Sun ORBs incorrectly used. We preserve this
  302. // here for backwards compatibility, but note that the current ORB must never
  303. // create a BAD_PARAM system exception with this minor code.
  304. public static final int LEGACY_SUN_NOT_SERIALIZABLE = SUNVMCID.value + 1 ;
  305. // Code Set related *******************************************************
  306. // If we don't always send the code set context, there's a possibility
  307. // of failure when fragments of a smaller request are interleved with
  308. // those of a first request with other large service contexts.
  309. //
  310. public static final boolean DEFAULT_ALWAYS_SEND_CODESET_CTX = true;
  311. public static final String ALWAYS_SEND_CODESET_CTX_PROPERTY
  312. = SUN_PREFIX + "codeset.AlwaysSendCodeSetCtx";
  313. // Use byte order markers in streams when applicable? This won't apply to
  314. // GIOP 1.1 due to limitations in the CDR encoding.
  315. public static final boolean DEFAULT_USE_BYTE_ORDER_MARKERS = true;
  316. public static final String USE_BOMS = SUN_PREFIX + "codeset.UseByteOrderMarkers";
  317. // Use byte order markers in encapsulations when applicable?
  318. public static final boolean DEFAULT_USE_BYTE_ORDER_MARKERS_IN_ENCAPS = false;
  319. public static final String USE_BOMS_IN_ENCAPS = SUN_PREFIX + "codeset.UseByteOrderMarkersInEncaps";
  320. // The CHAR_CODESETS and WCHAR_CODESETS allow the user to override the default
  321. // connection code sets. The value should be a comma separated list of OSF
  322. // registry numbers. The first number in the list will be the native code
  323. // set.
  324. //
  325. // Number can be specified as hex if preceded by 0x, otherwise they are
  326. // interpreted as decimal.
  327. //
  328. // Code sets that we accept currently (see core/OSFCodeSetRegistry):
  329. //
  330. // char/string:
  331. //
  332. // ISO8859-1 (Latin-1) 0x00010001
  333. // ISO646 (ASCII) 0x00010020
  334. // UTF-8 0x05010001
  335. //
  336. // wchar/string:
  337. //
  338. // UTF-16 0x00010109
  339. // UCS-2 0x00010100
  340. // UTF-8 0x05010001
  341. //
  342. // Note: The ORB will let you assign any of the above values to
  343. // either of the following properties, but the above assignments
  344. // are the only ones that won't get you into trouble.
  345. public static final String CHAR_CODESETS = SUN_PREFIX + "codeset.charsets";
  346. public static final String WCHAR_CODESETS = SUN_PREFIX + "codeset.wcharsets";
  347. // Constants to make stream format version code easier to read
  348. public static final byte STREAM_FORMAT_VERSION_1 = (byte)1;
  349. public static final byte STREAM_FORMAT_VERSION_2 = (byte)2;
  350. }