1 5 6 22 23 24 package org.omg.CORBA; 25 26 abstract public class ORB { 27 28 private static final String DEFAULT_ORB_KEY= "org.omg.CORBA.ORBClass"; 29 private static final String DEFAULT_ORB_SINGLETON_KEY= "org.omg.CORBA.ORBSingletonClass"; 30 private static final String DEFAULT_ORB_VALUE= "org.jacorb.orb.ORB"; 31 private static final String DEFAULT_ORB_SINGLETON_VALUE = "org.jacorb.orb.ORBSingleton"; 32 private static final java.lang.Object SYNCHRONIZER = new java.lang.Object (); 33 private static ORB _singleton_orb; 34 35 public static ORB 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 } 46 } 47 } 48 return _singleton_orb; 49 } 50 51 public static ORB init(String [] args, java.util.Properties props) 52 { 53 String 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 orb = create(className); 64 orb.set_parameters(args, props); 72 return orb; 73 } 74 75 public static ORB init(java.applet.Applet applet, java.util.Properties props) 76 { 77 String 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 orb = create(className); 87 orb.set_parameters(applet, props); 88 return orb; 89 } 90 private static ORB create(String className) 91 { 92 try 93 { 94 return (ORB ) Class.forName(className).newInstance(); 95 } 96 catch(Exception e) 97 { 98 e.printStackTrace(); 99 throw new INITIALIZE ("Could not instantiate ORB implementation: " + className); 100 } 101 } 102 103 104 121 abstract protected void set_parameters(String [] args, 122 java.util.Properties props); 123 124 abstract protected void set_parameters(java.applet.Applet app, 125 java.util.Properties props); 126 127 public void connect(org.omg.CORBA.Object obj) { 128 throw new org.omg.CORBA.NO_IMPLEMENT (); 129 } 130 131 public void disconnect(org.omg.CORBA.Object obj) { 132 throw new org.omg.CORBA.NO_IMPLEMENT (); 133 } 134 135 abstract public String [] list_initial_services(); 136 137 abstract public org.omg.CORBA.Object resolve_initial_references( 138 String object_name) 139 throws org.omg.CORBA.ORBPackage.InvalidName ; 140 141 abstract public String object_to_string(org.omg.CORBA.Object obj); 142 143 abstract public org.omg.CORBA.Object string_to_object(String str); 144 145 abstract public NVList create_list(int count); 146 147 abstract public NVList create_operation_list (org.omg.CORBA.Object oper); 148 abstract public NVList create_operation_list (org.omg.CORBA.OperationDef oper); 149 150 abstract public NamedValue create_named_value(String s, Any any, int flags); 151 152 abstract public ExceptionList create_exception_list(); 153 154 abstract public ContextList create_context_list(); 155 156 abstract public Context get_default_context(); 157 158 abstract public Environment create_environment(); 159 160 abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); 161 162 abstract public void send_multiple_requests_oneway(Request [] req); 163 164 abstract public void send_multiple_requests_deferred(Request [] req); 165 166 abstract public boolean poll_next_response(); 167 168 abstract public Request get_next_response() throws WrongTransaction ; 169 170 abstract public TypeCode get_primitive_tc(TCKind tcKind); 171 172 abstract public TypeCode create_struct_tc(String id, String name, 173 StructMember [] members); 174 175 abstract public TypeCode create_union_tc(String id, String name, 176 TypeCode discriminator_type, 177 UnionMember [] members); 178 179 abstract public TypeCode create_enum_tc(String id, String name, 180 String [] members); 181 182 abstract public TypeCode create_alias_tc(String id, String name, 183 TypeCode original_type); 184 185 abstract public TypeCode create_exception_tc(String id, String name, 186 StructMember [] members); 187 188 abstract public TypeCode create_interface_tc(String id, String name); 189 190 abstract public TypeCode create_string_tc(int bound); 191 192 abstract public TypeCode create_wstring_tc(int bound); 193 194 abstract public TypeCode create_sequence_tc(int bound, 195 TypeCode element_type); 196 197 abstract public TypeCode create_array_tc(int length, TypeCode element_type); 198 199 public TypeCode create_recursive_sequence_tc(int bound, int offset) { 200 throw new org.omg.CORBA.NO_IMPLEMENT (); 201 } 202 203 public org.omg.CORBA.TypeCode create_native_tc(String id, 204 String name) { 205 throw new org.omg.CORBA.NO_IMPLEMENT (); 206 } 207 208 public org.omg.CORBA.TypeCode create_abstract_interface_tc( 209 String id, 210 String name) { 211 throw new org.omg.CORBA.NO_IMPLEMENT (); 212 } 213 214 215 public org.omg.CORBA.TypeCode create_local_interface_tc( 216 String id, 217 String name) { 218 throw new org.omg.CORBA.NO_IMPLEMENT (); 219 } 220 221 222 public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) { 223 throw new org.omg.CORBA.NO_IMPLEMENT (); 224 } 225 226 227 public org.omg.CORBA.TypeCode create_value_tc(String id, 228 String name, 229 short type_modifier, 230 TypeCode concrete_base, 231 ValueMember [] members) { 232 throw new org.omg.CORBA.NO_IMPLEMENT (); 233 } 234 235 public org.omg.CORBA.TypeCode create_recursive_tc(String id) { 236 throw new org.omg.CORBA.NO_IMPLEMENT (); 237 } 238 239 public org.omg.CORBA.TypeCode create_value_box_tc(String id, 240 String name, 241 TypeCode boxed_type) { 242 throw new org.omg.CORBA.NO_IMPLEMENT (); 243 } 244 245 abstract public Any create_any(); 246 247 public org.omg.CORBA.Current get_current() { 248 throw new org.omg.CORBA.NO_IMPLEMENT (); 249 } 250 251 public void run() { 252 throw new org.omg.CORBA.NO_IMPLEMENT (); 253 } 254 255 public void shutdown(boolean wait_for_completion) { 256 throw new org.omg.CORBA.NO_IMPLEMENT (); 257 } 258 259 public void destroy() { 260 throw new org.omg.CORBA.NO_IMPLEMENT (); 261 } 262 263 public boolean work_pending() { 264 throw new org.omg.CORBA.NO_IMPLEMENT (); 265 } 266 267 public void perform_work() { 268 throw new org.omg.CORBA.NO_IMPLEMENT (); 269 } 270 271 public boolean get_service_information(short service_type, 272 ServiceInformationHolder service_info) { 273 throw new org.omg.CORBA.NO_IMPLEMENT (); 274 } 275 276 public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) 277 throws org.omg.CORBA.PolicyError { 278 throw new org.omg.CORBA.NO_IMPLEMENT (); 279 } 280 281 } 282 283 | Popular Tags |