-// Copyright (C) 2006-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#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 <iostream>
#include <fstream>
return true;
}
+void InitializeSSL()
+{
+ setSSLMode(true);
+ 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[])
{
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();
setsig(SIGTERM,&Handler);
#endif
+ InitializeSSL();
+
timer("Starting ");
long flags = RuntimeSALOME::UsePython + RuntimeSALOME::UseCorba + RuntimeSALOME::UseXml + \
RuntimeSALOME::UseCpp + RuntimeSALOME::UseSalome;
try
{
YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime();
+ runTime->loadModulCatalog();
CORBA::ORB_ptr orb = runTime->getOrb();
if (orb)
{
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
CORBA::Object_var obj = namingService.Resolve("/Kernel/ModulCatalog");
SALOME_ModuleCatalog::ModuleCatalog_var aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
if (! CORBA::is_nil(aModuleCatalog))
}
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");
if(myArgs.shutdown < 999)
{
p->shutdown(myArgs.shutdown);
+ shutdownServers();
}
delete p;
Runtime* r=YACS::ENGINE::getRuntime();