KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > util > ORBProperties


1 /*
2  * @(#)ORBProperties.java 1.12 03/12/19
3  *
4  * Copyright 2004 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
16 package com.sun.corba.se.impl.util;
17
18 import java.io.File JavaDoc;
19 import java.io.FileOutputStream JavaDoc;
20 import java.io.PrintWriter JavaDoc;
21
22 public class ORBProperties {
23
24     public static final String JavaDoc ORB_CLASS =
25     "org.omg.CORBA.ORBClass=com.sun.corba.se.impl.orb.ORBImpl";
26     public static final String JavaDoc ORB_SINGLETON_CLASS =
27     "org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.impl.orb.ORBSingleton";
28     
29     public static void main (String JavaDoc[] args) {
30
31     try {
32         // Check if orb.properties exists
33
String JavaDoc javaHome = System.getProperty("java.home");
34         File JavaDoc propFile = new File JavaDoc(javaHome + File.separator
35                      + "lib" + File.separator
36                      + "orb.properties");
37         
38         if (propFile.exists())
39         return;
40
41         // Write properties to orb.properties
42
FileOutputStream JavaDoc out = new FileOutputStream JavaDoc(propFile);
43         PrintWriter JavaDoc pw = new PrintWriter JavaDoc(out);
44
45         try {
46         pw.println(ORB_CLASS);
47         pw.println(ORB_SINGLETON_CLASS);
48         } finally {
49         pw.close();
50         out.close();
51         }
52
53     } catch (Exception JavaDoc ex) { }
54     
55     }
56 }
57
Popular Tags