DF SalomeLoggerServer with_loggerTraceCollector SalomeNS SalomeGenericObj
Registry SalomeCatalog ResourcesManager SalomeResourcesManager
SalomeNotification SalomeContainer SalomeSDS Launcher SalomeLauncher
- SalomeLifeCycleCORBA SalomeDSClient TOOLSDS SalomeKernelHelpers
+ SalomeLifeCycleCORBA SalomeDSClient TOOLSDS SalomeKernelHelpers SalomeORB
SalomeDSImpl SalomeDS SalomeCommunication SalomeDSCContainer)
# Temporary solution for package src\DSC on windows
IF(NOT WIN32)
SET(KERNEL_UtilsTest UtilsTest)
SET(KERNEL_with_loggerTraceCollector with_loggerTraceCollector)
SET(KERNEL_SalomeKernelHelpers SalomeKernelHelpers)
+SET(KERNEL_SalomeORB SalomeORB)
SALOME_TestModuleCatalog.idl
SALOME_CommonTypes.idl
SALOME_ExternalServerLauncher.idl
+ SALOME_Embedded_NamingService.idl
${CMAKE_CURRENT_BINARY_DIR}/Calcium_Ports.idl
)
--- /dev/null
+// Copyright (C) 2007-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
+//
+
+#ifndef _SALOME_EMBEDDED_NAMINGSERVICE_IDL_
+#define _SALOME_EMBEDDED_NAMINGSERVICE_IDL_
+
+module Engines
+{
+ typedef sequence<octet> IORType;
+
+ interface EmbeddedNamingService
+ {
+ void Register(in IORType ObjRef, in string Path);
+ void Destroy_FullDirectory(in string Path);
+ void Destroy_Name(in string Path);
+ IORType Resolve(in string Path);
+ IORType ResolveFirst(in string Path);
+ };
+};
+
+#endif
// C++ Methods
void Shutdown();
+ void DeclareUsingSalomeSession() { _isSSL = false; }
+
static const char *_ContainerManagerNameInNS;
protected:
//! attribute that contains the number of processes used in batch mode by MPI containers
int _nbprocUsed;
+ //! attribute that specifies the launch mode.
+ bool _isSSL = true;
+
static omni_mutex _numInstanceMutex ; // lib and instance protection
//! attributes to allow concurrency for // GiveContainer
${PROJECT_BINARY_DIR}/idl
)
+SET(SalomeORB_SOURCES
+ SALOME_KernelORB.cxx
+)
+
+ADD_LIBRARY(SalomeORB ${SalomeORB_SOURCES})
+TARGET_LINK_LIBRARIES(SalomeORB ${OMNIORB_LIBRARIES})
+INSTALL(TARGETS SalomeORB EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
SET(SalomeKernelHelpers_LIBS
- ${OMNIORB_LIBRARIES}
+ SalomeORB
SalomeNS
SALOMELocalTrace
SALOMEBasics
--- /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_KernelORB.hxx"
+
+namespace KERNEL {
+ /**
+ * This function returns a static reference to the orb. The orb can
+ * be used for example to initialize CORBA variables or to serialize
+ * and unserialize the CORBA objet to/from an IOR string.
+ */
+ CORBA::ORB_ptr getORB() {
+ static CORBA::ORB_ptr orb;
+ if(CORBA::is_nil(orb)){
+ int argc=0;
+ orb = CORBA::ORB_init(argc,0);
+ }
+ return orb;
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2021 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
+// 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
+//
+
+// Author: Guillaume Boulant (EDF/R&D)
+
+#pragma once
+
+#include "KernelHelpers.hxx"
+
+#include <omniORB4/CORBA.h>
+
+namespace KERNEL
+{
+ KERNELHELPERS_EXPORT CORBA::ORB_ptr getORB();
+}
namespace KERNEL {
- /**
- * This function returns a static reference to the orb. The orb can
- * be used for example to initialize CORBA variables or to serialize
- * and unserialize the CORBA objet to/from an IOR string.
- */
- CORBA::ORB_ptr getORB() {
- static CORBA::ORB_ptr orb;
- if(CORBA::is_nil(orb)){
- int argc=0;
- orb = CORBA::ORB_init(argc,0);
- }
- return orb;
- }
-
void assignNamingServiceSL()
{
if ( !_naming_service.get() )
#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
+#include "SALOME_KernelORB.hxx"
+
namespace KERNEL {
// ---------------------------------------------
// SALOME KERNEL main services
- KERNELHELPERS_EXPORT CORBA::ORB_ptr getORB();
KERNELHELPERS_EXPORT SALOME_NamingService_Abstract *getNamingService();
KERNELHELPERS_EXPORT void assignNamingServiceSL();
KERNELHELPERS_EXPORT SALOME_LifeCycleCORBA * getLifeCycleCORBA();
return rtn;
}
+void SALOME_Launcher::DeclareUsingSalomeSession()
+{
+ this->_ContManager->DeclareUsingSalomeSession();
+}
+
void
SALOME_Launcher::removeJob(CORBA::Long job_id)
{
// Save and load methods
virtual void loadJobs(const char* jobs_file);
virtual void saveJobs(const char* jobs_file);
+
+ void DeclareUsingSalomeSession();
static const char *_LauncherNameInNS;
SALOME_CPythonHelper cPyh;
cPyh.initializePython(argc,argv);
SALOME_Launcher *lServ(new SALOME_Launcher(orb,safePOA));
+ lServ->DeclareUsingSalomeSession();
lServ->_remove_ref();
//
SALOMESDS::DataServerManager *dsm(new SALOMESDS::DataServerManager(&cPyh,orb,root_poa));
${CMAKE_CURRENT_SOURCE_DIR}/../Basics
${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace
${CMAKE_CURRENT_SOURCE_DIR}/../Utils
+ ${CMAKE_CURRENT_SOURCE_DIR}/../KernelHelpers
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA
+ ${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_BINARY_DIR}/idl
)
NamingService_WaitForServerReadiness.cxx
SALOME_Fake_NamingService.cxx
SALOME_NamingService_Abstract.cxx
+ SALOME_Embedded_NamingService.cxx
)
-
ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
ADD_LIBRARY(SalomeNS ${SalomeNS_SOURCES})
ADD_DEPENDENCIES(SalomeNS SalomeIDLKernel)
-TARGET_LINK_LIBRARIES(SalomeNS OpUtil)
+TARGET_LINK_LIBRARIES(SalomeNS OpUtil SalomeORB)
INSTALL(TARGETS SalomeNS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
--- /dev/null
+// Copyright (C) 2021 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
+// 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_Embedded_NamingService.hxx"
+#include "SALOME_Fake_NamingService.hxx"
+#include "SALOME_KernelORB.hxx"
+
+#include <memory>
+#include <cstring>
+
+CORBA::Object_var IORToObject(const Engines::IORType& ObjRef)
+{
+ CORBA::ORB_ptr orb(KERNEL::getORB());
+ CORBA::ULong size(ObjRef.length());
+ std::unique_ptr<char[]> pt(new char[size+1]);
+ pt[size] = '\0';
+ for(CORBA::ULong i = 0 ; i < size ; ++i)
+ pt[i] = ObjRef[i];
+ CORBA::Object_var obj = orb->string_to_object(pt.get());
+ return obj;
+}
+
+Engines::IORType *ObjectToIOR(CORBA::Object_ptr obj)
+{
+ std::unique_ptr<Engines::IORType> ret(new Engines::IORType);
+ CORBA::ORB_ptr orb(KERNEL::getORB());
+ CORBA::String_var ior = orb->object_to_string(obj);
+ auto len( strlen(ior) );
+ ret->length( len );
+ for(std::size_t i = 0 ; i < len ; ++i)
+ (*ret)[i] = ior[i];
+ return ret.release();
+}
+
+void SALOME_Embedded_NamingService::Register(const Engines::IORType& ObjRef, const char *Path)
+{
+ SALOME_Fake_NamingService ns;
+ ns.Register(IORToObject(ObjRef),Path);
+}
+
+void SALOME_Embedded_NamingService::Destroy_FullDirectory(const char *Path)
+{
+ SALOME_Fake_NamingService ns;
+ ns.Destroy_FullDirectory(Path);
+}
+
+void SALOME_Embedded_NamingService::Destroy_Name(const char *Path)
+{
+ SALOME_Fake_NamingService ns;
+ ns.Destroy_Name(Path);
+}
+
+Engines::IORType *SALOME_Embedded_NamingService::Resolve(const char *Path)
+{
+ SALOME_Fake_NamingService ns;
+ CORBA::Object_var obj = ns.Resolve(Path);
+ return ObjectToIOR(obj);
+}
+
+Engines::IORType *SALOME_Embedded_NamingService::ResolveFirst(const char *Path)
+{
+ SALOME_Fake_NamingService ns;
+ CORBA::Object_var obj = ns.ResolveFirst(Path);
+ return ObjectToIOR(obj);
+}
--- /dev/null
+// Copyright (C) 2021 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
+// 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_defs.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_Embedded_NamingService)
+
+class NAMINGSERVICE_EXPORT SALOME_Embedded_NamingService : public virtual POA_Engines::EmbeddedNamingService
+{
+public:
+ void Register(const Engines::IORType& ObjRef, const char *Path) override;
+ void Destroy_FullDirectory(const char *Path) override;
+ void Destroy_Name(const char *Path) override;
+ Engines::IORType *Resolve(const char *Path) override;
+ Engines::IORType *ResolveFirst(const char *Path) override;
+};