SALOME_NamingService::SALOME_NamingService()
{
- MESSAGE("SALOME_NamingService default constructor");
_orb = CORBA::ORB::_nil();
_root_context = CosNaming::NamingContext::_nil();
}
SALOME_NamingService::SALOME_NamingService(CORBA::ORB_ptr orb)
{
- MESSAGE("SALOME_NamingService creation");
_orb = CORBA::ORB::_duplicate(orb);
_initialize_root_context();
}
void SALOME_NamingService::init_orb(CORBA::ORB_ptr orb)
{
- MESSAGE("SALOME_NamingService initialisation");
-
Utils_Locker lock (&_myMutex);
if(orb)
_orb = CORBA::ORB::_duplicate(orb);
const char* Path)
throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Register: " << Path);
-
Utils_Locker lock (&_myMutex);
// --- _current_context is replaced to the _root_context
CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path)
throw(ServiceUnreachable)
{
-// MESSAGE("BEGIN OF Resolve: " << Path);
-
Utils_Locker lock (&_myMutex);
// --- _current_context is replaced to the _root_context
CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path)
throw(ServiceUnreachable)
{
-// MESSAGE("ResolveFirst");
-
Utils_Locker lock (&_myMutex);
-// SCRUTE(Path);
std::string thePath = Path;
std::string basePath = "";
while (its != listElem.end())
{
- MESSAGE(*its);
-
if ((*its).find(name) == 0)
{
return Resolve((*its).c_str());
const int nbproc)
throw(ServiceUnreachable)
{
-// MESSAGE("ResolveComponent");
-
Utils_Locker lock (&_myMutex);
std::string name = "/Containers/";
if ( nbproc >= 1 )
{
- std::ostringstream suffix;
- suffix << "_" << nbproc;
+ std::ostringstream suffix;
+ suffix << "_" << nbproc;
ret += suffix.str();
}
int SALOME_NamingService::Find(const char* name)
throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Find " << name);
-
Utils_Locker lock (&_myMutex);
CORBA::Long occurence_number = 0 ;
bool SALOME_NamingService::Create_Directory(const char* Path) throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Create_Directory");
-
Utils_Locker lock (&_myMutex);
std::string path(Path);
if (path == "/")
{
- MESSAGE("Create Directory '/', just change to root_context");
_current_context = _root_context;
return true;
}
bool SALOME_NamingService::Change_Directory(const char* Path) throw(ServiceUnreachable)
{
-// MESSAGE("BEGIN OF Change_Directory " << Path);
Utils_Locker lock (&_myMutex);
std::string path(Path);
if (path == "/")
{
-// MESSAGE("Change_Directory is called to go to the root_context");
_current_context = _root_context;
return true;
}
char *SALOME_NamingService::Current_Directory() throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Current_Directory");
-
Utils_Locker lock (&_myMutex);
CosNaming::NamingContext_var ref_context = _current_context;
void SALOME_NamingService::list() throw(ServiceUnreachable)
{
- MESSAGE("Begin of list");
-
Utils_Locker lock (&_myMutex)
;
if (binding->binding_type == CosNaming::ncontext)
{
- MESSAGE( "Context : " << bindingName[0].id );
-
try
{
Change_Directory(bindingName[0].id);
else if (binding->binding_type == CosNaming::nobject)
{
- MESSAGE( "Object : " << bindingName[0].id );
+ MESSAGE( "list(): no Object : " << bindingName[0].id );
}
}
std::vector<std::string> SALOME_NamingService::list_directory() throw(ServiceUnreachable)
{
-// MESSAGE("list_directory");
Utils_Locker lock (&_myMutex);
std::vector<std::string> dirList ;
dirList.resize(0);
std::vector<std::string> SALOME_NamingService::list_subdirs() throw(ServiceUnreachable)
{
- MESSAGE("list_subdirs");
Utils_Locker lock (&_myMutex);
std::vector<std::string> dirList ;
dirList.resize(0);
}
}
- for (unsigned int ind = 0; ind < dirList.size(); ind++)
- MESSAGE("list_directory : Object : " << dirList[ind]);
+ // for (unsigned int ind = 0; ind < dirList.size(); ind++)
+ // MESSAGE("list_directory : Object : " << dirList[ind]);
binding_iterator->destroy();
std::vector<std::string> SALOME_NamingService::list_directory_recurs()
throw(ServiceUnreachable)
{
- MESSAGE("list_directory_recurs");
-
Utils_Locker lock (&_myMutex);
std::vector<std::string> dirList ;
void SALOME_NamingService::Destroy_Name(const char* Path)
throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Destroy_Name " << Path);
-
Utils_Locker lock (&_myMutex);
std::string path(Path);
context_name[0].id =
CORBA::string_dup(splitPath[dimension_resultat].c_str());
context_name[0].kind = CORBA::string_dup("object");
- SCRUTE(context_name[0].id);
+ //SCRUTE(context_name[0].id);
_current_context->unbind(context_name);
- MESSAGE("The object " << context_name[0].id << " has been deleted");
+ //MESSAGE("The object " << context_name[0].id << " has been deleted");
}
catch (CosNaming::NamingContext::NotFound& ex)
void SALOME_NamingService::Destroy_Directory(const char* Path) throw(ServiceUnreachable)
{
- MESSAGE("BEGIN OF Destroy_Directory " << Path);
-
Utils_Locker lock (&_myMutex);
std::string path(Path);
try
{
_current_context->destroy();
- MESSAGE( "The context " << path << " has been deleted" );
isContextDestroyed = true;
}
try
{
_current_context->unbind(context_name);
- MESSAGE( "The bind to the context "
- << context_name[0].id
- << " has been deleted" );
}
catch (CosNaming::NamingContext::NotFound& ex)
void SALOME_NamingService::Destroy_FullDirectory(const char* Path) throw(ServiceUnreachable)
{
- MESSAGE("begin of Destroy_FullDirectory " << Path);
//no need to lock here because method calls are threadsafe.
if( Change_Directory(Path) )
{
void SALOME_NamingService::_initialize_root_context()
{
- //MESSAGE("Get the root context");
//no lock here because initialization is expected to be done once.
try
{
void SALOME_NamingService::_Find(const char* name,
CORBA::Long& occurence_number)
{
- MESSAGE("BEGIN OF _Find "<< occurence_number << " " << name);
-
CosNaming::BindingList_var binding_list;
CosNaming::BindingIterator_var binding_iterator;
CosNaming::Binding_var binding;
CosNaming::NamingContext_var contextToFind,
bool& notFound)
{
- MESSAGE("BEGIN OF _current_Directory");
-
CosNaming::BindingList_var binding_list;
CosNaming::BindingIterator_var binding_iterator;
CosNaming::Binding_var binding;
if (temp_context->_is_equivalent(contextToFind))
{
- MESSAGE("The context is found, we stop the search");
+ //MESSAGE("The context is found, we stop the search");
notFound = false;
- SCRUTE(notFound);
+ //SCRUTE(notFound);
}
if (notFound)
{
- SCRUTE(bindingName[0].id);
+ //SCRUTE(bindingName[0].id);
Change_Directory(bindingName[0].id);
_current_directory(splitPath,
lengthResult,
_current_context = ref_context;
- MESSAGE("Just before the delete of "
- << splitPath[lengthResult-1]);
+ // MESSAGE("Just before the delete of "
+ // << splitPath[lengthResult-1]);
splitPath.pop_back();
lengthResult--;
}