1. /*
  2. * @(#)ORBProperties.java 1.10 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * Licensed Materials - Property of IBM
  9. * RMI-IIOP v1.0
  10. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  11. *
  12. * US Government Users Restricted Rights - Use, duplication or
  13. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. */
  15. package com.sun.corba.se.internal.util;
  16. import java.io.File;
  17. import java.io.FileOutputStream;
  18. import java.io.PrintWriter;
  19. public class ORBProperties {
  20. public static final String ORB_CLASS =
  21. "org.omg.CORBA.ORBClass=com.sun.corba.se.internal.Interceptors.PIORB";
  22. public static final String ORB_SINGLETON_CLASS =
  23. "org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton";
  24. public static void main (String[] args) {
  25. try {
  26. // Check if orb.properties exists
  27. String javaHome = System.getProperty("java.home");
  28. File propFile = new File(javaHome + File.separator
  29. + "lib" + File.separator
  30. + "orb.properties");
  31. if (propFile.exists())
  32. return;
  33. // Write properties to orb.properties
  34. FileOutputStream out = new FileOutputStream(propFile);
  35. PrintWriter pw = new PrintWriter(out);
  36. try {
  37. pw.println(ORB_CLASS);
  38. pw.println(ORB_SINGLETON_CLASS);
  39. } finally {
  40. pw.close();
  41. out.close();
  42. }
  43. } catch (Exception ex) { }
  44. }
  45. }