X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMESDS%2FSALOMESDS_DataServerManager.cxx;h=8296ba8f2f7b1fb92d0e83df930b7719d5d2ceca;hb=e429ce02076e083051c6520e0d7113022bd67b18;hp=326adefe19bcd194955b9f28a1cc7b9c0732dc3c;hpb=7d6c556a77d4c54a2e3630280e42003790c34300;p=modules%2Fkernel.git diff --git a/src/SALOMESDS/SALOMESDS_DataServerManager.cxx b/src/SALOMESDS/SALOMESDS_DataServerManager.cxx index 326adefe1..8296ba8f2 100644 --- a/src/SALOMESDS/SALOMESDS_DataServerManager.cxx +++ b/src/SALOMESDS/SALOMESDS_DataServerManager.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ const char DataServerManager::DFT_SCOPE_NAME_IN_NS[]="Default"; DataServerManager::DataServerManager(int argc, char *argv[], CORBA::ORB_ptr orb, PortableServer::POA_ptr poa):_orb(CORBA::ORB::_duplicate(orb)) { - DataScopeServer *dftScope(new DataScopeServer(orb,DFT_SCOPE_NAME_IN_NS));//_remove_ref will be call by DataScopeServer::shutdownIfNotHostedByDSM + DataScopeServer *dftScope(new DataScopeServer(orb,SALOME::DataScopeKiller::_nil(),DFT_SCOPE_NAME_IN_NS));//_remove_ref will be call by DataScopeServer::shutdownIfNotHostedByDSM PortableServer::POAManager_var pman(poa->the_POAManager()); CORBA::PolicyList policies; policies.length(1); @@ -122,6 +122,11 @@ typename T::PtrType CreateDataScope(const std::string& scopeName, const std::vec std::string command(oss.str()); SALOME_ContainerManager::MakeTheCommandToBeLaunchedASync(command); int status(SALOME_ContainerManager::SystemThreadSafe(command.c_str())); + if(status!=0) + { + std::ostringstream oss2; oss2 << "CreateDataScope : Fail to launch \"" << command << "\" ! Return code was : " << status << " !"; + throw Exception(oss2.str()); + } int count(SALOME_ContainerManager::GetTimeOutToLoaunchServer()); typename T::VarType ret(T::nil()); while (CORBA::is_nil(ret) && count) @@ -225,7 +230,10 @@ SALOME::DataScopeServerBase_ptr DataServerManager::retriveDataScope(const char * void DataServerManager::removeDataScope(const char *scopeName) { SALOME::DataScopeServerBase_var scs(getScopePtrGivenName(scopeName)); - scs->shutdownIfNotHostedByDSM(); + SALOME::DataScopeKiller_ptr killer; + if(scs->shutdownIfNotHostedByDSM(killer)) + killer->shutdown(); + CORBA::release(killer); } void DataServerManager::cleanScopesInNS() @@ -246,7 +254,13 @@ void DataServerManager::shutdownScopes() { std::vector scopeNames(listOfScopesCpp()); for(std::vector::const_iterator it=scopeNames.begin();it!=scopeNames.end();it++) - getScopePtrGivenName(*it)->shutdownIfNotHostedByDSM(); + { + SALOME::DataScopeServerBase_var scope(getScopePtrGivenName(*it)); + SALOME::DataScopeKiller_ptr killer; + if(scope->shutdownIfNotHostedByDSM(killer)) + killer->shutdown(); + CORBA::release(killer); + } } std::string DataServerManager::CreateAbsNameInNSFromScopeName(const std::string& scopeName) @@ -277,7 +291,6 @@ std::vector DataServerManager::listOfScopesCpp() SALOME::DataScopeServerBase_var DataServerManager::GetScopePtrGivenName(const std::string& scopeName, const std::vector& scopes, SALOME_NamingService& ns) { - std::size_t sz(scopes.size()); if(std::find(scopes.begin(),scopes.end(),scopeName)==scopes.end()) { std::ostringstream oss; oss << "DataServerManager::getScopePtrGivenName : scope name \"" << scopeName << "\" does not exist !";