KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > C > ORB


1 /***** Copyright (c) 1999 Object Management Group. Unlimited rights to
2        duplicate and use this code are hereby granted provided that this
3        copyright notice is included.
4 *****/

5
6 /***** This class is specifed by the mapping as abstract.
7        A "dummy" implementation is provided so that the "official" org.omg.*
8        packages may be compiled.
9        
10        ORB-vendors shall provide a complete implementation of the class
11        by extending it with a vendor-specific class which
12        provides "real" implementations for all the methods. E.g.
13
14        package com.acme_orb_vendor.CORBA;
15        public class ORB extends org.omg.CORBA { ... }
16
17        In order to be conformant the class shall support the signatures
18        specified here, but will have an orb-specific implementation.
19
20        The class may support additional vendor specific functionality.
21 *****/

22
23
24 package org.omg.CORBA;
25
26 abstract public class ORB {
27
28     private static final String JavaDoc DEFAULT_ORB_KEY= "org.omg.CORBA.ORBClass";
29     private static final String JavaDoc DEFAULT_ORB_SINGLETON_KEY= "org.omg.CORBA.ORBSingletonClass";
30     private static final String JavaDoc DEFAULT_ORB_VALUE= "org.jacorb.orb.ORB";
31     private static final String JavaDoc DEFAULT_ORB_SINGLETON_VALUE = "org.jacorb.orb.ORBSingleton";
32     private static final java.lang.Object JavaDoc SYNCHRONIZER = new java.lang.Object JavaDoc();
33     private static ORB JavaDoc _singleton_orb;
34
35     public static ORB JavaDoc init()
36     {
37         if(_singleton_orb == null)
38         {
39             synchronized(SYNCHRONIZER)
40             {
41                 if(_singleton_orb == null)
42                 {
43                     _singleton_orb = create(DEFAULT_ORB_SINGLETON_VALUE);
44                     //_singleton_orb.set_parameters((String[]) null, null);
45
}
46             }
47         }
48         return _singleton_orb;
49     }
50
51     public static ORB JavaDoc init(String JavaDoc[] args, java.util.Properties JavaDoc props)
52     {
53         String JavaDoc className = null;
54         if(props != null)
55         {
56
57             className = props.getProperty(DEFAULT_ORB_KEY);
58         }
59         if(className == null)
60         {
61             className = System.getProperty(DEFAULT_ORB_KEY, DEFAULT_ORB_VALUE);
62         }
63         ORB JavaDoc orb = create(className);
64 // synchronized(SYNCHRONIZER)
65
// {
66
// if(_singleton_orb == null)
67
// {
68
// _singleton_orb = orb;
69
// }
70
// }
71
orb.set_parameters(args, props);
72         return orb;
73     }
74
75     public static ORB JavaDoc init(java.applet.Applet JavaDoc applet, java.util.Properties JavaDoc props)
76     {
77         String JavaDoc className = applet.getParameter(DEFAULT_ORB_KEY);
78         if(className == null && props != null)
79         {
80             className = props.getProperty(DEFAULT_ORB_KEY);
81         }
82         if(className == null)
83         {
84             className = DEFAULT_ORB_VALUE;
85         }
86         ORB JavaDoc orb = create(className);
87         orb.set_parameters(applet, props);
88         return orb;
89     }
90     private static ORB JavaDoc create(String JavaDoc className)
91     {
92         try
93         {
94             return (ORB JavaDoc) Class.forName(className).newInstance();
95         }
96         catch(Exception JavaDoc e)
97         {
98             e.printStackTrace();
99             throw new INITIALIZE JavaDoc("Could not instantiate ORB implementation: " + className);
100         }
101     }
102
103
104     /*
105     public static ORB init() {
106     throw new org.omg.CORBA.NO_IMPLEMENT();
107     }
108
109     public static ORB init(String[] args, java.util.Properties props) {
110 new RuntimeException().printStackTrace();
111
112     throw new org.omg.CORBA.NO_IMPLEMENT();
113     }
114
115
116     public static ORB init(java.applet.Applet app, java.util.Properties props) {
117 new RuntimeException().printStackTrace();
118     throw new org.omg.CORBA.NO_IMPLEMENT();
119     }
120     */

121     abstract protected void set_parameters(String JavaDoc[] args,
122                                     java.util.Properties JavaDoc props);
123
124     abstract protected void set_parameters(java.applet.Applet JavaDoc app,
125                                     java.util.Properties JavaDoc props);
126
127     public void connect(org.omg.CORBA.Object JavaDoc obj) {
128         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
129     }
130
131     public void disconnect(org.omg.CORBA.Object JavaDoc obj) {
132         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
133     }
134
135     abstract public String JavaDoc[] list_initial_services();
136
137     abstract public org.omg.CORBA.Object JavaDoc resolve_initial_references(
138                                     String JavaDoc object_name)
139             throws org.omg.CORBA.ORBPackage.InvalidName JavaDoc;
140
141     abstract public String JavaDoc object_to_string(org.omg.CORBA.Object JavaDoc obj);
142
143     abstract public org.omg.CORBA.Object JavaDoc string_to_object(String JavaDoc str);
144
145     abstract public NVList JavaDoc create_list(int count);
146
147     abstract public NVList JavaDoc create_operation_list (org.omg.CORBA.Object JavaDoc oper);
148     abstract public NVList JavaDoc create_operation_list (org.omg.CORBA.OperationDef JavaDoc oper);
149
150     abstract public NamedValue JavaDoc create_named_value(String JavaDoc s, Any JavaDoc any, int flags);
151
152     abstract public ExceptionList JavaDoc create_exception_list();
153
154     abstract public ContextList JavaDoc create_context_list();
155
156     abstract public Context JavaDoc get_default_context();
157
158     abstract public Environment JavaDoc create_environment();
159
160     abstract public org.omg.CORBA.portable.OutputStream JavaDoc create_output_stream();
161
162     abstract public void send_multiple_requests_oneway(Request JavaDoc[] req);
163
164     abstract public void send_multiple_requests_deferred(Request JavaDoc[] req);
165
166     abstract public boolean poll_next_response();
167
168     abstract public Request JavaDoc get_next_response() throws WrongTransaction JavaDoc;
169
170     abstract public TypeCode JavaDoc get_primitive_tc(TCKind JavaDoc tcKind);
171
172     abstract public TypeCode JavaDoc create_struct_tc(String JavaDoc id, String JavaDoc name,
173                                     StructMember JavaDoc[] members);
174
175     abstract public TypeCode JavaDoc create_union_tc(String JavaDoc id, String JavaDoc name,
176                                     TypeCode JavaDoc discriminator_type,
177                                     UnionMember JavaDoc[] members);
178
179     abstract public TypeCode JavaDoc create_enum_tc(String JavaDoc id, String JavaDoc name,
180                                     String JavaDoc[] members);
181
182     abstract public TypeCode JavaDoc create_alias_tc(String JavaDoc id, String JavaDoc name,
183                                     TypeCode JavaDoc original_type);
184
185     abstract public TypeCode JavaDoc create_exception_tc(String JavaDoc id, String JavaDoc name,
186                                                StructMember JavaDoc[] members);
187
188     abstract public TypeCode JavaDoc create_interface_tc(String JavaDoc id, String JavaDoc name);
189
190     abstract public TypeCode JavaDoc create_string_tc(int bound);
191
192     abstract public TypeCode JavaDoc create_wstring_tc(int bound);
193
194     abstract public TypeCode JavaDoc create_sequence_tc(int bound,
195                                     TypeCode JavaDoc element_type);
196
197     abstract public TypeCode JavaDoc create_array_tc(int length, TypeCode JavaDoc element_type);
198
199     public TypeCode JavaDoc create_recursive_sequence_tc(int bound, int offset) {
200         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
201     }
202
203     public org.omg.CORBA.TypeCode JavaDoc create_native_tc(String JavaDoc id,
204                                     String JavaDoc name) {
205         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
206     }
207
208     public org.omg.CORBA.TypeCode JavaDoc create_abstract_interface_tc(
209                                     String JavaDoc id,
210                                     String JavaDoc name) {
211         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
212     }
213
214
215     public org.omg.CORBA.TypeCode JavaDoc create_local_interface_tc(
216                                     String JavaDoc id,
217                                     String JavaDoc name) {
218         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
219     }
220
221
222     public org.omg.CORBA.TypeCode JavaDoc create_fixed_tc(short digits, short scale) {
223         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
224     }
225
226
227     public org.omg.CORBA.TypeCode JavaDoc create_value_tc(String JavaDoc id,
228                                     String JavaDoc name,
229                                     short type_modifier,
230                                     TypeCode JavaDoc concrete_base,
231                                     ValueMember JavaDoc[] members) {
232         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
233     }
234
235     public org.omg.CORBA.TypeCode JavaDoc create_recursive_tc(String JavaDoc id) {
236         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
237     }
238
239     public org.omg.CORBA.TypeCode JavaDoc create_value_box_tc(String JavaDoc id,
240                                     String JavaDoc name,
241                                     TypeCode JavaDoc boxed_type) {
242         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
243     }
244     
245     abstract public Any JavaDoc create_any();
246
247     public org.omg.CORBA.Current JavaDoc get_current() {
248         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
249     }
250
251     public void run() {
252         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
253     }
254
255     public void shutdown(boolean wait_for_completion) {
256         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
257     }
258
259     public void destroy() {
260         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
261     }
262
263     public boolean work_pending() {
264         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
265     }
266
267     public void perform_work() {
268         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
269     }
270
271     public boolean get_service_information(short service_type,
272                                     ServiceInformationHolder JavaDoc service_info) {
273         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
274     }
275
276     public org.omg.CORBA.Policy JavaDoc create_policy(int type, org.omg.CORBA.Any JavaDoc val)
277                         throws org.omg.CORBA.PolicyError JavaDoc {
278         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
279     }
280
281 }
282
283
Popular Tags