SALOMEDS_TMPFile_i.hxx
libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDS_la_LDFLAGS = -no-undefined -version-info=0:0:0
+libSalomeDS_la_LDFLAGS = -Wl,-E -no-undefined -version-info=0:0:0 @LDEXPDYNFLAGS@
libSalomeDS_la_LIBADD = $(COMMON_LIBS)
#
// IDL headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
+#include <SALOME_NamingService.hxx>
using namespace SALOMEDS;
SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
{
- SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
- // Activate the objects. This tells the POA that the objects are ready to accept requests.
- PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
- aStudyManager_i->register_name("/myStudyManager");
+ cout << "############## CreateStudyManager" << endl;
+ SALOME_NamingService namingService(orb);
+ CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
+ SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
+ if( CORBA::is_nil(theManager) ) {
+ SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
+ // Activate the objects. This tells the POA that the objects are ready to accept requests.
+ PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
+ aStudyManager_i->register_name("/myStudyManager");
+ }
return new SALOMEDS_StudyManager();
}