Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / Session / Session_ServerThread.cxx
index 47f8bff0f0daba352e84960473242ac2e9b38e61..d9ef4f806902ba74c26c36a56cdaf4c6bbf6aedf 100755 (executable)
@@ -17,7 +17,7 @@
 //  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -34,7 +34,8 @@
 
 #include "SALOME_Container_i.hxx"
 #include "SALOME_ContainerManager.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
+#include <SALOMEDSClient.hxx>
+#include <SALOMEDSClient_ClientFactory.hxx>
 #include "SALOME_ModuleCatalog_impl.hxx"
 #include "RegistryService.hxx"
 #include "Session_Session_i.hxx"
@@ -61,58 +62,44 @@ const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container",
                                                              "SalomeAppEngine",
                                                               "ContainerManager"};
 
-//=============================================================================
 /*! 
- *  default constructor not for use
- */
-//=============================================================================
-
+  default constructor not for use
+*/
 Session_ServerThread::Session_ServerThread()
 {
   ASSERT(0); // must not be called
 }
 
-//=============================================================================
 /*! 
- *  constructor
- */
-//=============================================================================
-
+  constructor
+*/
 Session_ServerThread::Session_ServerThread(int argc,
                                           char ** argv, 
                                           CORBA::ORB_ptr orb, 
-                                          PortableServer::POA_ptr poa,
-                                          QMutex *GUIMutex)
+                                          PortableServer::POA_ptr poa)
 {
   //MESSAGE("Session_ServerThread Constructor " << argv[0]);
   _argc = argc;
   _argv = argv;
   _orb = CORBA::ORB::_duplicate(orb);
   _root_poa = PortableServer::POA::_duplicate(poa);
-  _GUIMutex = GUIMutex;
   _servType =-1;
   _NS = new SALOME_NamingService(_orb); // one instance per server to limit
                                         // multi thread coherence problems
 }
 
-//=============================================================================
 /*! 
- *  destructor 
- */
-//=============================================================================
-
+  destructor 
+*/
 Session_ServerThread::~Session_ServerThread()
 {
   //MESSAGE("~Session_ServerThread "<< _argv[0]);
 }
 
-//=============================================================================
 /*! 
- *  run the thread : activate one servant, the servant type is given by
- *  argument _argv[0]
- */
-//=============================================================================
-
+  run the thread : activate one servant, the servant type is given by
+  argument _argv[0]
+*/
 void Session_ServerThread::Init()
 {
   MESSAGE("Session_ServerThread::Init "<< _argv[0]); 
@@ -168,6 +155,7 @@ void Session_ServerThread::Init()
            {
              NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
              ActivateEngine(_argc, _argv);
+             break;
            }
          case 6: // Container Manager
            {
@@ -184,12 +172,6 @@ void Session_ServerThread::Init()
       }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateModuleCatalog(int argc,
                                                 char ** argv)
 {
@@ -229,12 +211,6 @@ void Session_ServerThread::ActivateModuleCatalog(int argc,
     }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateSALOMEDS(int argc,
                                            char ** argv)
 {
@@ -245,15 +221,7 @@ void Session_ServerThread::ActivateSALOMEDS(int argc,
       // counted objects, they will be deleted by the POA when they are no
       // longer needed.    
 
-      SALOMEDS_StudyManager_i * myStudyManager_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 myStudyManager_iid
-       = _root_poa->activate_object(myStudyManager_i);
-      myStudyManager_i->register_name("/myStudyManager");
+      ClientFactory::createStudyManager(_orb,_root_poa);
     }
   catch(CORBA::SystemException&)
     {
@@ -276,12 +244,6 @@ void Session_ServerThread::ActivateSALOMEDS(int argc,
     }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateRegistry(int argc,
                                            char ** argv)
 {
@@ -338,12 +300,6 @@ void Session_ServerThread::ActivateRegistry(int argc,
     }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateContainerManager(int argc,
                                             char ** argv)
 {
@@ -376,12 +332,6 @@ void Session_ServerThread::ActivateContainerManager(int argc,
     }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateContainer(int argc,
                                             char ** argv)
 {
@@ -466,12 +416,6 @@ void Session_ServerThread::ActivateContainer(int argc,
     }
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/)
 {
     try
@@ -499,29 +443,30 @@ void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/)
       }  
 }
 
-//=============================================================================
-/*! 
- *  
- */
-//=============================================================================
-
 void Session_ServerThread::ActivateSession(int argc,
                                           char ** argv)
 {
   MESSAGE("Session_ServerThread::ActivateSession() not implemented!");
 }
 
+/*! 
+  constructor 
+*/
 Session_SessionThread::Session_SessionThread(int argc,
                                             char** argv, 
                                             CORBA::ORB_ptr orb, 
                                             PortableServer::POA_ptr poa,
                                             QMutex* GUIMutex,
                                             QWaitCondition* GUILauncher)
-: Session_ServerThread(argc, argv, orb, poa, GUIMutex),
+: Session_ServerThread(argc, argv, orb, poa),
+  _GUIMutex( GUIMutex ),
   _GUILauncher( GUILauncher )
 {
 }
 
+/*! 
+  destructor 
+*/
 Session_SessionThread::~Session_SessionThread()
 {
 }