corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java
changeset 43737 b1a42dfc5eec
parent 43345 a3460624dc33
child 45144 a81f7f7ccb59
equal deleted inserted replaced
43593:06bce0388880 43737:b1a42dfc5eec
   104  * <OL>
   104  * <OL>
   105  *     <LI>check in Applet parameter or application string array, if any
   105  *     <LI>check in Applet parameter or application string array, if any
   106  *
   106  *
   107  *     <LI>check in properties parameter, if any
   107  *     <LI>check in properties parameter, if any
   108  *
   108  *
   109  *     <LI>check in the System properties
   109  *     <LI>check in the System properties, if any
   110  *
   110  *
   111  *     <LI>check in the orb.properties file located in the user.home
   111  *     <LI>check in the orb.properties file located in the user.home
   112  *         directory (if any)
   112  *         directory, if any
   113  *
   113  *
   114  *     <LI>check in the orb.properties file located in the java.home/lib
   114  *     <LI>check in the orb.properties file located in the run-time image,
   115  *         directory (if any)
   115  *         if any
   116  *
   116  *
   117  *     <LI>fall back on a hardcoded default behavior (use the Java&nbsp;IDL
   117  *     <LI>fall back on a hardcoded default behavior (use the Java&nbsp;IDL
   118  *         implementation)
   118  *         implementation)
   119  * </OL>
   119  * </OL>
   120  * <P>
   120  * <P>
   168  * or orb.properties, it will be
   168  * or orb.properties, it will be
   169  * located, and loaded via the system class loader.
   169  * located, and loaded via the system class loader.
   170  * Thus, where appropriate, it is necessary that
   170  * Thus, where appropriate, it is necessary that
   171  * the classes for this alternative ORBSingleton are available on the application's class path.
   171  * the classes for this alternative ORBSingleton are available on the application's class path.
   172  * It should be noted that the singleton ORB is system wide.
   172  * It should be noted that the singleton ORB is system wide.
   173  *
   173  * <P>
   174  * When a per-application ORB is created via the 2-arg init methods,
   174  * When a per-application ORB is created via the 2-arg init methods,
   175  * then it will be located using the thread context class loader.
   175  * then it will be located using the thread context class loader.
       
   176  * <P>
       
   177  * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location,
       
   178  * in the Java run-time image, to search for orb.properties.
       
   179  * This location is not intended for user editable configuration files.
       
   180  * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties,
       
   181  * and thereafter the ${java.home}/lib directory.
   176  *
   182  *
   177  * @since   JDK1.2
   183  * @since   JDK1.2
   178  */
   184  */
   179 abstract public class ORB {
   185 abstract public class ORB {
   180 
   186 
   269                         if (value != null)
   275                         if (value != null)
   270                             return value ;
   276                             return value ;
   271                     }
   277                     }
   272 
   278 
   273                     String javaHome = System.getProperty("java.home");
   279                     String javaHome = System.getProperty("java.home");
   274                     fileName = javaHome + File.separator
   280 
   275                         + "lib" + File.separator + "orb.properties";
   281                     fileName = javaHome + File.separator + "conf"
   276                     props = getFileProperties( fileName ) ;
   282                             + File.separator + "orb.properties";
       
   283                     props = getFileProperties(fileName);
       
   284 
       
   285                     if (props != null) {
       
   286                         String value = props.getProperty(name);
       
   287                         if (value != null)
       
   288                             return value;
       
   289                     }
       
   290 
       
   291                     fileName = javaHome + File.separator + "lib"
       
   292                             + File.separator + "orb.properties";
       
   293                     props = getFileProperties(fileName);
   277 
   294 
   278                     if (props == null)
   295                     if (props == null)
   279                         return null ;
   296                         return null;
   280                     else
   297                     else
   281                         return props.getProperty( name ) ;
   298                         return props.getProperty(name);
   282                 }
   299                 }
   283             }
   300             }
   284         );
   301         );
   285 
   302 
   286         return propValue;
   303         return propValue;