00001 #ifndef COSNAMING_IDL 00002 #define COSNAMING_IDL 00003 00014 #pragma prefix "omg.org" 00015 00016 module CosNaming 00017 { 00018 typedef string Istring; 00019 00020 struct NameComponent 00021 { 00022 Istring id; 00023 Istring kind; 00024 }; 00025 00026 typedef sequence <NameComponent> Name; 00027 00028 enum BindingType 00029 { 00030 nobject, 00031 ncontext 00032 }; 00033 00034 struct Binding 00035 { 00036 Name binding_name; 00037 BindingType binding_type; 00038 }; 00039 00040 typedef sequence <Binding> BindingList; 00041 00042 interface BindingIterator; 00043 00056 interface NamingContext 00057 { 00058 enum NotFoundReason 00059 { 00060 missing_node, 00061 not_context, 00062 not_object 00063 }; 00064 00069 exception NotFound 00070 { 00071 NotFoundReason why; 00072 Name rest_of_name; 00073 }; 00074 00081 exception CannotProceed 00082 { 00083 NamingContext cxt; 00084 Name rest_of_name; 00085 }; 00086 00092 exception InvalidName {}; 00093 00099 exception AlreadyBound {}; 00100 00105 exception NotEmpty {}; 00106 00123 void bind (in Name n, in Object obj) 00124 raises (NotFound, CannotProceed, InvalidName, AlreadyBound); 00125 00135 void rebind (in Name n, in Object obj) 00136 raises (NotFound, CannotProceed, InvalidName); 00137 00153 void bind_context (in Name n, in NamingContext nc) 00154 raises (NotFound, CannotProceed, InvalidName, AlreadyBound); 00155 00166 void rebind_context (in Name n, in NamingContext nc) 00167 raises (NotFound, CannotProceed, InvalidName); 00168 00188 Object resolve (in Name n) 00189 raises (NotFound, CannotProceed, InvalidName); 00190 00202 void unbind (in Name n) 00203 raises (NotFound, CannotProceed, InvalidName); 00204 00213 NamingContext new_context (); 00214 00233 NamingContext bind_new_context (in Name n) 00234 raises (NotFound, CannotProceed, InvalidName, AlreadyBound); 00235 00244 void destroy () raises (NotEmpty); 00245 00261 void list (in unsigned long how_many, 00262 out BindingList bl, 00263 out BindingIterator bi); 00264 }; 00265 00271 interface BindingIterator 00272 { 00280 boolean next_one (out Binding b); 00281 00289 boolean next_n (in unsigned long how_many, out BindingList bl); 00294 void destroy (); 00295 }; 00296 00297 00303 interface NamingContextExt: NamingContext 00304 { 00305 typedef string StringName; 00306 typedef string Address; 00307 typedef string URLString; 00308 00309 00316 StringName to_string (in Name n) 00317 raises (InvalidName); 00318 00319 00326 Name to_name (in StringName sn) 00327 raises (InvalidName); 00328 00332 exception InvalidAddress {}; 00333 00334 00342 URLString to_url (in Address addr, in StringName sn) 00343 raises (InvalidAddress, InvalidName); 00344 00352 Object resolve_str (in StringName n) 00353 raises (NotFound, CannotProceed, InvalidName); 00354 00355 }; 00356 }; 00357 00358 #endif