< prev index next >

src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java

Print this page


   1 /*
   2  * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 319             }
 320         }
 321 
 322         String val = null;
 323         try {
 324             val = resources.getString(key);
 325         } catch (MissingResourceException mre) {
 326         }
 327 
 328         if (val == null) {
 329             return ("[missing resource: " + key + "]");
 330         } else {
 331             return (val);
 332         }
 333     }
 334 
 335     /**
 336      * Main program to start a registry. <br>
 337      * The port number can be specified on the command line.
 338      */

 339     public static void main(String args[])
 340     {
 341         // Create and install the security manager if one is not installed
 342         // already.
 343         if (System.getSecurityManager() == null) {
 344             System.setSecurityManager(new RMISecurityManager());
 345         }
 346 
 347         try {
 348             /*
 349              * Fix bugid 4147561: When JDK tools are executed, the value of
 350              * the CLASSPATH environment variable for the shell in which they
 351              * were invoked is no longer incorporated into the application
 352              * class path; CLASSPATH's only effect is to be the value of the
 353              * system property "env.class.path".  To preserve the previous
 354              * (JDK1.1 and JDK1.2beta3) behavior of this tool, however, its
 355              * CLASSPATH should still be considered when resolving classes
 356              * being unmarshalled.  To effect this old behavior, a class
 357              * loader that loads from the file path specified in the
 358              * "env.class.path" property is created and set to be the context


   1 /*
   2  * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 319             }
 320         }
 321 
 322         String val = null;
 323         try {
 324             val = resources.getString(key);
 325         } catch (MissingResourceException mre) {
 326         }
 327 
 328         if (val == null) {
 329             return ("[missing resource: " + key + "]");
 330         } else {
 331             return (val);
 332         }
 333     }
 334 
 335     /**
 336      * Main program to start a registry. <br>
 337      * The port number can be specified on the command line.
 338      */
 339     @SuppressWarnings("deprecation")
 340     public static void main(String args[])
 341     {
 342         // Create and install the security manager if one is not installed
 343         // already.
 344         if (System.getSecurityManager() == null) {
 345             System.setSecurityManager(new RMISecurityManager());
 346         }
 347 
 348         try {
 349             /*
 350              * Fix bugid 4147561: When JDK tools are executed, the value of
 351              * the CLASSPATH environment variable for the shell in which they
 352              * were invoked is no longer incorporated into the application
 353              * class path; CLASSPATH's only effect is to be the value of the
 354              * system property "env.class.path".  To preserve the previous
 355              * (JDK1.1 and JDK1.2beta3) behavior of this tool, however, its
 356              * CLASSPATH should still be considered when resolving classes
 357              * being unmarshalled.  To effect this old behavior, a class
 358              * loader that loads from the file path specified in the
 359              * "env.class.path" property is created and set to be the context


< prev index next >