X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fyacsloader%2Fdriver.cxx;h=95f0e4de67035ac0b07e5b6df04a61f94328a5d6;hb=91945d98482a02a05a3f5df7511a4e5760db2a94;hp=85cd180e7b7341d50131b18d31bd202a50743edc;hpb=6ba49e820fe6fae65b15b38fbeeb4698f2aa902d;p=modules%2Fyacs.git diff --git a/src/yacsloader/driver.cxx b/src/yacsloader/driver.cxx index 85cd180e7..95f0e4de6 100644 --- a/src/yacsloader/driver.cxx +++ b/src/yacsloader/driver.cxx @@ -31,14 +31,14 @@ #include "LinkInfo.hxx" #include "ObserverAsPlugin.hxx" -#ifdef SALOME_KERNEL #include "KernelBasis.hxx" #include "SALOME_Launcher.hxx" #include "ServiceUnreachable.hxx" #include "SALOME_NamingService_Wrapper.hxx" +#include "SALOME_NamingService.hxx" #include "SALOME_ModuleCatalog.hh" +#include "SALOMESDS_DataServerManager.hxx" #include "Basics_Utils.hxx" -#endif #include #include @@ -303,6 +303,33 @@ void InitializeSSL() KERNEL::getLauncherSA(); } +void shutdownServers() +{ + // shutdown data server scopes + try + { + YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime(); + runTime->loadModulCatalog(); + CORBA::ORB_ptr orb = runTime->getOrb(); + if (orb) + { + SALOME_NamingService_Wrapper namingService(orb); + CORBA::Object_var objDSM(namingService.Resolve(SALOMESDS::DataServerManager::NAME_IN_NS)); + SALOME::DataServerManager_var dsm(SALOME::DataServerManager::_narrow(objDSM)); + if ( !CORBA::is_nil(dsm) ) + dsm->shutdownScopes(); + } + } + catch(const CORBA::Exception& ) + { + // ignore and continue + } + catch(ServiceUnreachable& e) + { + // ignore and continue + } +} + int main (int argc, char* argv[]) { @@ -315,7 +342,7 @@ int main (int argc, char* argv[]) myArgs.dump = 0; myArgs.loadState = (char *)""; myArgs.xmlSchema = (char *)""; - myArgs.shutdown = 1; + myArgs.shutdown = 10; myArgs.reset = 0; myArgs.killPort = 0; myArgs.init_ports.clear(); @@ -359,6 +386,7 @@ int main (int argc, char* argv[]) try { YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime(); + runTime->loadModulCatalog(); CORBA::ORB_ptr orb = runTime->getOrb(); if (orb) { @@ -498,11 +526,12 @@ int main (int argc, char* argv[]) } if (myArgs.stop) + { if (strlen(myArgs.dumpErrorFile) >0) executor.setStopOnError(true, myArgs.dumpErrorFile); else executor.setStopOnError(false, myArgs.dumpErrorFile); - + } if(myArgs.display>0) { std::ofstream f("toto"); @@ -564,6 +593,7 @@ int main (int argc, char* argv[]) if(myArgs.shutdown < 999) { p->shutdown(myArgs.shutdown); + shutdownServers(); } delete p; Runtime* r=YACS::ENGINE::getRuntime();