#include "YACSGuiLoader.hxx"
#include "ComponentInstance.hxx"
-#include "SALOME_NamingService.hxx"
+#include "ServiceUnreachable.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_ModuleCatalog.hxx"
#include "SALOME_ModuleCatalog.hh"
#include "SALOMEDS_Tool.hxx"
CORBA::ORB_ptr orb = runTime->getOrb();
if (orb)
{
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
CORBA::Object_ptr obj = namingService.Resolve("/Kernel/ModulCatalog");
SALOME_ModuleCatalog::ModuleCatalog_var aModuleCatalog =
SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
CORBA::ORB_ptr orb = runTime->getOrb();
if (!orb) return _machineList;
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
SALOME_LifeCycleCORBA lcc(&namingService);
CORBA::Object_var obj =
#include <Python.h>
#include "SALOME_LifeCycleCORBA.hxx"
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
+#include "SALOME_Launcher.hxx"
#include "GuiExecutor.hxx"
#include "GuiObserver_i.hxx"
#include "OutputPort.hxx"
#include "Executor.hxx"
+#include "KernelBasis.hxx"
//#define _DEVDEBUG_
#include "YacsTrace.hxx"
_loadStateFile = "";
_breakpointList.clear();
+ if(getSSLMode())
+ {
+ KERNEL::getLauncherSA();
+ }
}
DEBTRACE("Create YACS ORB engine!");
YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime();
CORBA::ORB_ptr orb = runTime->getOrb();
- SALOME_NamingService namingService(orb);
- SALOME_LifeCycleCORBA lcc(&namingService);
- ostringstream containerName;
- containerName << "localhost/YACSContainer";
- Engines::EngineComponent_var comp = lcc.FindOrLoad_Component(containerName.str().c_str(), "YACS" );
- _engineRef =YACS_ORB::YACS_Gen::_narrow(comp);
- YASSERT(!CORBA::is_nil(_engineRef));
+ SALOME_NamingService_Wrapper namingService(orb);
+ //int iii(0); std::cin >> iii;
+ {
+ SALOME_LifeCycleCORBA lcc(&namingService);
+ ostringstream containerName;
+ containerName << "localhost/YACSContainer";
+ Engines::EngineComponent_var comp = lcc.FindOrLoad_Component(containerName.str().c_str(), "YACS" );
+ _engineRef =YACS_ORB::YACS_Gen::_narrow(comp);
+ YASSERT(!CORBA::is_nil(_engineRef));
+ }
}
checkEndOfDataflow(); // --- to allow change of the _isRunning state
void BatchJobsListDialog::getSalomeLauncher(){
YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime();
CORBA::ORB_ptr orb = runTime->getOrb();
- SALOME_NamingService* NS = new SALOME_NamingService(orb);
- CORBA::Object_var obj = NS->Resolve("/SalomeLauncher");
+ SALOME_NamingService_Wrapper NS;
+ CORBA::Object_var obj = NS.Resolve("/SalomeLauncher");
_salome_launcher = Engines::SalomeLauncher::_narrow(obj);
if (CORBA::is_nil(_salome_launcher))
throw YACS::Exception("Salome Launcher not reachable!!");
#define LISTJOBS_GUI_H
#include <QWidget>
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_Launcher.hh"
// Kind of column
DistributedPythonNode.hxx
PyOptimizerAlg.hxx
VisitorSalomeSaveState.hxx
+ SALOME_NamingService_Wrapper.hxx
)
# --- sources ---
SalomeOptimizerLoop.cxx
PyOptimizerAlg.cxx
VisitorSalomeSaveState.cxx
+ SALOME_NamingService_Wrapper.cxx
)
# --- rules ---
#include "AutoLocker.hxx"
#ifdef SALOME_KERNEL
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "SALOME_Exception.hh"
#endif
if(_setOfOutputDataStreamPort.size() == 0)return;
CORBA::Object_var objComponent=((SalomeComponent*)_component)->getCompoPtr();
- SALOME_NamingService NS(getSALOMERuntime()->getOrb()) ;
+ SALOME_NamingService_Wrapper NS(getSALOMERuntime()->getOrb()) ;
SALOME_LifeCycleCORBA LCC(&NS) ;
CORBA::Object_var obj = NS.Resolve("/ConnectionManager");
Engines::ConnectionManager_var manager=Engines::ConnectionManager::_narrow(obj);
if(ids.size() == 0)
return;
- SALOME_NamingService NS(getSALOMERuntime()->getOrb()) ;
+ SALOME_NamingService_Wrapper NS(getSALOMERuntime()->getOrb()) ;
SALOME_LifeCycleCORBA LCC(&NS) ;
CORBA::Object_var obj = NS.Resolve("/ConnectionManager");
Engines::ConnectionManager_var manager=Engines::ConnectionManager::_narrow(obj);
#include "CalStreamPort.hxx"
#ifdef SALOME_KERNEL
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
-#include "SALOME_NamingService.hxx"
#include "SALOME_ResourcesManager.hxx"
#include "SALOME_ContainerManager.hxx"
#include "SALOMEconfig.h"
using namespace std;
using namespace YACS::ENGINE;
+std::unique_ptr<SALOME_NamingService_Container_Abstract> RuntimeSALOME::getNS()
+{
+ std::unique_ptr<SALOME_NamingService_Container_Abstract> ret(new SALOME_NamingService_Wrapper);
+ return ret;
+}
+
void RuntimeSALOME::setRuntime(long flags, int argc, char* argv[]) // singleton creation (not thread safe!)
{
if (! Runtime::_singleton)
std::vector< std::pair<std::string,int> > RuntimeSALOME::getCatalogOfComputeNodes() const
{
CORBA::ORB_ptr orb(getOrb());
- SALOME_NamingService namingService;
+ SALOME_NamingService_Wrapper namingService;
try
{
namingService.init_orb(orb);
#include <omniORBpy.h>
#include "Runtime.hxx"
-#include<string>
-#include<set>
-
+#include <memory>
+#include <string>
+#include <set>
+
+class SALOME_NamingService_Container_Abstract;
+
namespace YACS
{
namespace ENGINE
UseSalome = 32
} FLAGS;
+#ifndef SWIG
+ std::unique_ptr<SALOME_NamingService_Container_Abstract> getNS();
+#endif
// singleton creation
static void setRuntime(long flags = UsePython+UseCorba+UseXml+UseCpp+UseSalome,
int argc = 0, char* argv[] = NULL);
--- /dev/null
+// Copyright (C) 2021 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SALOME_NamingService_Wrapper.hxx"
+
+#include "SALOME_NamingService.hxx"
+#include "SALOME_Fake_NamingService.hxx"
+#include "KernelBasis.hxx"
+
+SALOME_NamingService_Wrapper::SALOME_NamingService_Wrapper()
+{
+ this->initializeEffectiveNS();
+}
+
+SALOME_NamingService_Wrapper::SALOME_NamingService_Wrapper(CORBA::ORB_ptr orb)
+{
+ this->initializeEffectiveNS();
+ this->_effective_ns->init_orb(orb);
+}
+
+SALOME_NamingService_Wrapper::SALOME_NamingService_Wrapper(const SALOME_NamingService_Wrapper& other):_effective_ns(other._effective_ns->cloneCoVar())
+{
+}
+
+void SALOME_NamingService_Wrapper::initializeEffectiveNS()
+{
+ if(getSSLMode())
+ _effective_ns.reset( new SALOME_Fake_NamingService );
+ else
+ _effective_ns.reset( new SALOME_NamingService );
+}
--- /dev/null
+// Copyright (C) 2021 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "SALOME_NamingService_Abstract.hxx"
+
+#include <memory>
+
+/*!
+ * Decorator class that allows YACS engine to switch between :
+ * - NamingService CORBA server (SALOME_NamingService)
+ * - NamingService embedded (SALOME_Fake_NamingService)
+ */
+class SALOME_NamingService_Wrapper : public SALOME_NamingService_Abstract
+{
+public:
+ SALOME_NamingService_Wrapper();
+ SALOME_NamingService_Wrapper(CORBA::ORB_ptr orb);
+ std::string repr() override { return _effective_ns->repr(); }
+ void init_orb(CORBA::ORB_ptr orb=0) override { _effective_ns->init_orb(orb); }
+ void Register(CORBA::Object_ptr ObjRef, const char* Path) override { _effective_ns->Register(ObjRef,Path); }
+ CORBA::Object_ptr Resolve(const char* Path) override { return _effective_ns->Resolve(Path); }
+ CORBA::Object_ptr ResolveFirst(const char* Path) override { return _effective_ns->ResolveFirst(Path); }
+ void Destroy_Name(const char* Path) override { _effective_ns->Destroy_Name(Path); }
+ void Destroy_Directory(const char* Path) override { _effective_ns->Destroy_Directory(Path); }
+ void Destroy_FullDirectory(const char* Path) override { _effective_ns->Destroy_FullDirectory(Path); }
+ bool Change_Directory(const char* Path) override { return _effective_ns->Change_Directory(Path); }
+ std::vector<std::string> list_subdirs() override { return _effective_ns->list_directory(); }
+ std::vector<std::string> list_directory() override { return _effective_ns->list_directory(); }
+ std::vector<std::string> list_directory_recurs() override { return _effective_ns->list_directory_recurs(); }
+ SALOME_NamingService_Abstract *clone() override { return new SALOME_NamingService_Wrapper(*this); }
+ CORBA::Object_ptr ResolveComponent(const char* hostname, const char* containerName, const char* componentName, const int nbproc=0) override { return _effective_ns->ResolveComponent(hostname,containerName,componentName,nbproc); }
+private:
+ SALOME_NamingService_Wrapper(const SALOME_NamingService_Wrapper& other);
+ void initializeEffectiveNS();
+private:
+ std::unique_ptr<SALOME_NamingService_Abstract> _effective_ns;
+};
#include "AutoLocker.hxx"
#ifdef SALOME_KERNEL
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#endif
}
//throw Exception("SalomeComponent::load : no container specified !!! To be implemented in executor to allocate default a Container in case of presenceOfDefaultContainer.");
//This component has no specified container : use default container policy
- SALOME_NamingService ns(getSALOMERuntime()->getOrb());
+ SALOME_NamingService_Wrapper ns(getSALOMERuntime()->getOrb());
SALOME_LifeCycleCORBA LCC(&ns);
Engines::ContainerParameters params;
LCC.preSet(params);
#include "ServiceNode.hxx"
#include "Proc.hxx"
-#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "SALOME_ContainerManager.hxx"
#include "Basics_Utils.hxx"
#define _DEVDEBUG_
#include "SalomeContainerTools.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
-#include "SALOME_NamingService.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_ResourcesManager.hxx"
#include "SALOME_ContainerManager.hxx"
#include "Container.hxx"
YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime();
CORBA::ORB_ptr orb = runTime->getOrb();
if (!orb) return properties;
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
SALOME_LifeCycleCORBA lcc(&namingService);
CORBA::Object_var obj = namingService.Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
if (CORBA::is_nil(obj))
void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames, SalomeContainerHelper *schelp, SalomeContainerToolsBase& sct, int& shutdownLevel, const Container *cont, const Task *askingNode)
{
CORBA::ORB_ptr orb(getSALOMERuntime()->getOrb());
- SALOME_NamingService ns;
+ SALOME_NamingService_Wrapper ns;
try
{
ns.init_orb(orb);
#include "CORBANode.hxx"
#ifdef SALOME_KERNEL
-#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#endif
#include "SalomeProc.hxx"
#include "Basics_Utils.hxx"
-#include "SALOME_NamingService.hxx"
#include "SALOME_KernelServices.hxx"
#include "SALOMEDS.hh"
#include "SALOMEDS_Attributes.hh"
SALOME_CONFIGURE_FILE(resources/SalomeApp.xml.in
resources/SalomeApp.xml
INSTALL ${SALOME_YACS_INSTALL_RES_DATA})
+
+SALOME_CONFIGURE_FILE(resources/SalomeApp.xml.in
+ resources/SalomeAppSL.xml
+ INSTALL ${SALOME_YACS_INSTALL_RES_DATA})
#include "ObserverAsPlugin.hxx"
#ifdef SALOME_KERNEL
-#include "SALOME_NamingService.hxx"
+#include "KernelBasis.hxx"
+#include "SALOME_Launcher.hxx"
+#include "ServiceUnreachable.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_ModuleCatalog.hh"
#include "Basics_Utils.hxx"
#endif
return true;
}
+void InitializeSSL()
+{
+ setSSLMode(true);
+ KERNEL::getLauncherSA();
+}
+
int main (int argc, char* argv[])
{
setsig(SIGTERM,&Handler);
#endif
+ InitializeSSL();
+
timer("Starting ");
long flags = RuntimeSALOME::UsePython + RuntimeSALOME::UseCorba + RuntimeSALOME::UseXml + \
RuntimeSALOME::UseCpp + RuntimeSALOME::UseSalome;
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))
interfaceName, False)
SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
- # --- store a naming service interface instance in _naming_service atribute
- self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
-
SALOMERuntime.RuntimeSALOME_setRuntime(1)
SALOMERuntime.SALOMEDispatcher_setSALOMEDispatcher()
r=pilot.getRuntime()
#include "SalomeResourceModel.hxx"
#include "RuntimeSALOME.hxx"
#include "SALOME_ResourcesManager.hxx"
+#include "SALOME_NamingService_Wrapper.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include <ctime>
CORBA::ORB_ptr orb = runTime->getOrb();
if (!orb) return resultat;
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
SALOME_LifeCycleCORBA lcc(&namingService);
CORBA::Object_var obj;
CORBA::ORB_ptr orb = runTime->getOrb();
if (!orb) return result;
- SALOME_NamingService namingService(orb);
+ SALOME_NamingService_Wrapper namingService(orb);
SALOME_LifeCycleCORBA lcc(&namingService);
CORBA::Object_var obj;