KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > corba > TheORB


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle.
23 Contributor(s): Areski Flissi.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.corba;
28
29 /**
30  * This class encapsulates the VisiBroker CORBA::ORB singleton object.
31  *
32  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
33  * @version 0.2
34  */

35
36 public abstract class TheORB
37     extends TheORBSingleton
38 {
39     // ==================================================================
40
//
41
// Internal state.
42
//
43
// ==================================================================
44

45     // ==================================================================
46
//
47
// Constructor.
48
//
49
// ==================================================================
50

51     /**
52      ** The default constructor.
53      **/

54     private
55     TheORB()
56     {
57     }
58
59     // ==================================================================
60
//
61
// Internal methods.
62
//
63
// ==================================================================
64

65     // ==================================================================
66
//
67
// Public methods.
68
//
69
// ==================================================================
70

71     /**
72      * Initialize the VisiBroker CORBA::ORB singleton object.
73      *
74      * @param args The command line arguments.
75      *
76      * @return The command line arguments without VisiBroker options.
77      */

78     public static String JavaDoc[]
79     initialize(String JavaDoc[] args)
80     {
81                 
82         // Manage CORBA initial references provided as Multicast
83
// Address group (eg 224.0.0.100)
84

85         for (int i = 0; i < args.length; i++) {
86             if (args[i].equals("-ORBInitRef")) {
87                 i++;
88                 String JavaDoc arg = args[i];
89                 int index = arg.indexOf('=');
90                 String JavaDoc location = arg.substring(index + 1);
91                 if (location.startsWith("mcast:")) {
92
93                     // Store the IOR obtained from the MULTICAST server
94
// in the command line arguments.
95
args[i] =
96                         arg.substring(0, index) + '=' + TheORBSingleton.request_ior(location);
97                 }
98
99             }
100         }
101         
102         
103         
104         // Initialize the ORB.
105
setORB( org.omg.CORBA.ORB.init(args, null) );
106         
107         // Parse specific VisiBroker arguments.
108
return remove_ORB_arguments(args);
109     }
110     
111     /**
112      * Destroy the CORBA::ORB singleton object.
113      */

114     public static void
115     destroy()
116     {
117         // Not provided by VisiBroker!!!
118
// getORB().destroy();
119
}
120 }
121
122
123
124
125
Popular Tags