- if (dimension_resultat > 0)
- {
- // A directory is treated (not only an object name)
- // test if the directory where ObjRef should be recorded already exists
- // If not, create the new context
-
- try
- {
- CORBA::Object_var obj = _current_context->resolve(context_name);
- _current_context = CosNaming::NamingContext::_narrow(obj);
- }
-
- catch (CosNaming::NamingContext::NotFound &)
- {
- // --- failed to resolve, therefore assume cold start
- not_exist = true;
- }
-
- catch (CosNaming::NamingContext::InvalidName &)
- {
- INFOS("Register() : CosNaming::NamingContext::InvalidName");
- }
-
- catch (CosNaming::NamingContext::CannotProceed &)
- {
- INFOS("Register() : CosNaming::NamingContext::CannotProceed");
- }
-
- catch (CORBA::SystemException&)
- {
- INFOS("Register() : CORBA::SystemException: "
- << "unable to contact the naming service");
- throw ServiceUnreachable();
- }
-
- if (not_exist)
- {
- try
- {
- context_name.length(1);
- for (int i = 0 ; i < dimension_resultat ;i++)
- {
- context_name[0].id =
- CORBA::string_dup(splitPath[i].c_str());
- context_name[0].kind = CORBA::string_dup("dir");
- // SCRUTE(_context_name[0].id);
- // --- check if the path is created
- try
- {
- // --- if the context is already created, nothing to do
- CORBA::Object_var obj =
- _current_context->resolve(context_name);
- _current_context =
- CosNaming::NamingContext::_narrow(obj);
- }
-
- catch (CosNaming::NamingContext::NotFound &)
- {
- // --- the context must be created
- CosNaming::NamingContext_var temp_context =
- _current_context->bind_new_context(context_name);
- _current_context = temp_context;
- }
- }
- }
-
- catch (CosNaming::NamingContext::AlreadyBound&)
- {
- INFOS("Register() : CosNaming::NamingContext::AlreadyBound");
- }
+ if (dimension_resultat > 0){
+ // A directory is treated (not only an object name)
+ // test if the directory where ObjRef should be recorded already exists
+ // If not, create the new context
+
+ try{
+ CORBA::Object_var obj = _current_context->resolve(context_name);
+ _current_context = CosNaming::NamingContext::_narrow(obj);
+ }