]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Draft
authorageay <ageay>
Fri, 7 Jan 2005 15:30:10 +0000 (15:30 +0000)
committerageay <ageay>
Fri, 7 Jan 2005 15:30:10 +0000 (15:30 +0000)
src/Container/Component_i.cxx
src/Container/Container_i.cxx
src/Container/Makefile.in
src/Container/SALOME_Component_i.hxx
src/Container/SALOME_Container_i.hxx
src/LifeCycleCORBA/Makefile.in
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx
src/OCCViewer/Makefile.in
src/Plot2d/Makefile.in

index 0e28bd47d681594b02c1b2674c8702db82cd086d..cce549493df40ed3eb04fcad54acb45074507672 100644 (file)
@@ -27,6 +27,7 @@
 //  $Header$
 
 #include "SALOME_Component_i.hxx"
+#include "SALOME_Container_i.hxx"
 #include "RegistryConnexion.hxx"
 #include "OpUtil.hxx"
 #include <stdio.h>
@@ -393,3 +394,20 @@ CORBA::Long Engines_Component_i::CpuUsed_impl() {
 void Engines_Component_i::sendMessage(const char *event_type, const char *message) {
     _notifSupplier->Send(graphName(), nodeName(), event_type, message);
 }
+
+string Engines_Component_i::GetDynLibraryName(const char *componentName)
+{
+  string ret="lib";
+  ret+=componentName;
+  ret+="Engine.so";
+  return ret;
+}
+
+string Engines_Component_i::BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname)
+{
+  string ret=Engines_Container_i::BuildContainerNameForNS(ContainerName,hostname);
+  ret+="/";
+  ret+=ComponentName;
+  return ret;
+}
+
index ca47f23d9da2532f8aa3c385cf20e820ec7a2e30..f2dba59063381ea09dbe0564d45797b586e256d8 100644 (file)
@@ -32,6 +32,7 @@
 #include "SALOME_NamingService.hxx"
 #include "Utils_SINGLETON.hxx"
 #include "OpUtil.hxx"
+#include <string.h>
 #include <stdio.h>
 #include <dlfcn.h>
 #include <unistd.h>
@@ -52,6 +53,8 @@ char ** _ArgV ;
 extern "C" {void ActSigIntHandler() ; }
 extern "C" {void SigIntHandler(int, siginfo_t *, void *) ; }
 
+const char *Engines_Container_i::_defaultContainerName="FactoryServer";
+
 Engines_Container_i::Engines_Container_i () :
  _numInstance(0)
 {
@@ -98,17 +101,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb,
 
   SCRUTE(hostname);
 
-  _containerName = "/Containers/";
-  if (strlen(containerName)== 0)
-    {
-      _containerName += hostname;
-    }
-  else
-    {
-      _containerName += hostname;
-      _containerName += "/" ;
-      _containerName += containerName;
-    }
+  _containerName = BuildContainerNameForNS(containerName,hostname.c_str());
 
   _orb = CORBA::ORB::_duplicate(orb) ;
   _poa = PortableServer::POA::_duplicate(poa) ;
@@ -154,6 +147,13 @@ void Engines_Container_i::ping()
   MESSAGE("Engines_Container_i::ping() pid "<< getpid());
 }
 
+// shutdown corba server
+void Engines_Container_i::Shutdown()
+{
+  MESSAGE("Engines_Container_i::Shutdown()");
+  _orb->shutdown(0);
+}
+
 //! Kill current container
 bool Engines_Container_i::Kill_impl() {
   MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName "
@@ -457,3 +457,27 @@ CORBA::Long Engines_Container_i::getPID() {
 char* Engines_Container_i::getHostName() {
     return((char*)(GetHostname().c_str()));
 }
+
+// Retrieves only with container naming convention if it is a python container
+bool Engines_Container_i::isPythonContainer(const char* ContainerName)
+{
+  bool ret=false;
+  int len=strlen(ContainerName);
+  if(len>=2)
+    if(strcmp(ContainerName+len-2,"Py")==0)
+      ret=true;
+  return ret;
+}
+
+string Engines_Container_i::BuildContainerNameForNS(const char *ContainerName, const char *hostname)
+{
+  string ret="/Containers/";
+  ret += hostname;
+  ret+="/";
+  if (strlen(ContainerName)== 0)
+    ret+=_defaultContainerName;
+  else
+    ret += ContainerName;
+  return ret;
+}
+
index 729ee66791fee3f82b830c0d8054e023aa13af9f..96c370046d2c21f7557de746721d819bd2b47f3a 100644 (file)
@@ -38,8 +38,8 @@ EXPORT_PYSCRIPTS = SALOME_ComponentPy.py SALOME_ContainerPy.py
 
 EXPORT_HEADERS = \
        SALOME_Component_i.hxx \
-       SALOME_ContainerManager.hxx \
-       SALOME_Container_i.hxx
+       SALOME_Container_i.hxx \
+       SALOME_ContainerManager.hxx
 
 # Libraries targets
 
@@ -56,8 +56,8 @@ BIN_SERVER_IDL = SALOME_Component.idl SALOME_ContainerManager.idl
 CPPFLAGS+= $(PYTHON_INCLUDES) $(MPI_INCLUDE) $(OCC_INCLUDES) $(QT_MT_INCLUDES)
 CXXFLAGS+=$(OCC_CXXFLAGS)
 
-LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace
+LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace -lSalomeResourcesManager
 
-LIBS += @LDEXPDYNFLAGS@ $(PYTHON_LIBS) $(MPI_LIBS) -lCASCatch
+LIBS += @LDEXPDYNFLAGS@ $(PYTHON_LIBS) $(MPI_LIBS)
 
 @CONCLUDE@
index 2911434da75cfa8b56fc96088133de21f47e97a9..620ca149985180f4ad5e05556e2a2f8757a9a46a 100644 (file)
@@ -92,6 +92,8 @@ public:
   long CpuUsed() ;
   CORBA::Long CpuUsed_impl() ;
 
+  static std::string GetDynLibraryName(const char *componentName);
+  static std::string BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname);
 protected:
   std::string _instanceName ;
   std::string _interfaceName ;
index 6f309c50c8302c1d91249d0562d18a7680b9e23c..90c3d1d8173c1caf14f7953f2399348f64edaa5a 100644 (file)
@@ -71,13 +71,16 @@ public:
   char* name();
   char* machineName();
   void ping();
-
+  void Shutdown();
   //! Kill current container
   bool Kill_impl() ;
 
   char* getHostName();
   CORBA::Long getPID();
+  static bool isPythonContainer(const char* ContainerName);
 
+  static std::string BuildContainerNameForNS(const char *ContainerName, const char *hostname);
+  static const char *_defaultContainerName;
 protected:
 
   SALOME_NamingService *_NS ;
index 33ee1ac8177237a20a2c510aa58d01382ffae7be..e2171d8b6392de05bac925e05499b7c43b9db55e 100644 (file)
@@ -43,15 +43,17 @@ EXPORT_PYSCRIPTS = LifeCycleCORBA.py
 LIB = libSalomeLifeCycleCORBA.la
 LIB_SRC = SALOME_LifeCycleCORBA.cxx
 LIB_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl \
-                SALOME_ModuleCatalog.idl
+                SALOME_ModuleCatalog.idl SALOME_ContainerManager.idl
 
 # Executables targets
 BIN = TestLifeCycleCORBA
 BIN_SRC =
 BIN_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl \
-                SALOME_ModuleCatalog.idl
+                SALOME_ModuleCatalog.idl SALOME_ContainerManager.idl
 
-LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace
+CPPFLAGS += $(QT_MT_INCLUDES)
+
+LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSalomeContainer -lSalomeResourcesManager
 
 @CONCLUDE@
 
index 7908d60aead9ffa91c5c1924cdf0082d586114a3..c7bbd10dd0b07d88810493dca5b064ed5e55825e 100644 (file)
 
 #include "SALOME_LifeCycleCORBA.hxx"
 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
+#include "SALOME_ContainerManager.hxx"
+#include "SALOME_Component_i.hxx"
 #include "SALOME_NamingService.hxx"
 using namespace std;
 
-SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA()
-{
-  _NS = NULL;
-  _FactoryServer = NULL ;
-}
-
 SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
 {
   _NS = ns;
-  _FactoryServer = NULL ;
+  //add try catch
+  CORBA::Object_var obj=_NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
+  _ContManager=Engines::ContainerManager::_narrow(obj);
 }
 
 SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
@@ -86,6 +84,7 @@ string SALOME_LifeCycleCORBA::ContainerName(
     theComputerContainer += "/" ;
     theComputerContainer += *theContainer ;
   }
+  delete [] ContainerName;
   return theComputerContainer ;
 }
 
@@ -106,316 +105,76 @@ string SALOME_LifeCycleCORBA::ComputerPath(
   return CORBA::string_dup( path ) ;
 }
 
-Engines::Container_var SALOME_LifeCycleCORBA::FindContainer(const char *containerName ) {
-  ASSERT(_NS != NULL);
-  string cont ;
-  if ( strncmp( containerName , "/Containers/" , 12 ) ) { // Compatibility ...
-    string theComputer ;
-    string theContainer ;
-    cont = ContainerName( containerName , &theComputer , &theContainer ) ;
-  }
-  else {
-    cont = containerName ;
-  }
-  try {
-
-    SCRUTE( cont );
-
-    CORBA::Object_var obj = _NS->Resolve( cont.c_str() );
-    if( !CORBA::is_nil( obj ) ) {
-      return Engines::Container::_narrow( obj ) ;
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component
+                                  (const char *containerName,
+                                  const char *componentName)
+{
+  MachineList_var listOfMachine=new MachineList;
+  listOfMachine->length(1);
+  listOfMachine[0]=CORBA::string_dup(GetHostname().c_str());
+  Engines::Component_ptr ret=DoesExistComponent(componentName,containerName,listOfMachine.in());
+  if(CORBA::is_nil(ret))
+    {
+      Engines::Container_var cont=_ContManager->FindOrStartContainer(containerName,listOfMachine);
+      string implementation=Engines_Component_i::GetDynLibraryName(componentName);
+      return cont->load_impl(componentName, implementation.c_str());
     }
-  }
-  catch (ServiceUnreachable&) {
-    INFOS("Caught exception: Naming Service Unreachable");
-  }
-  catch (...) {
-    INFOS("Caught unknown exception.");
-  }
-  return Engines::Container::_nil();
+  else
+    return ret;
 }
 
-Engines::Container_var SALOME_LifeCycleCORBA::FindOrStartContainer(
-                                              const string aComputerContainer ,
-                                              const string theComputer ,
-                                              const string theContainer ) {
-  Engines::Container_var aContainer = FindContainer( aComputerContainer.c_str() ) ;
-  Engines::Container_var aFactoryServer ;
-  SCRUTE( aComputerContainer ) ;
-  SCRUTE( theComputer ) ;
-  SCRUTE( theContainer ) ;
-  bool pyCont = false ;
-  int len = theContainer.length() ;
-  if ( !strcmp( &theContainer.c_str()[len-2] , "Py" ) ) {
-    pyCont = true ;
-  }
-  if ( !CORBA::is_nil( aContainer ) ) {
-    return aContainer ;
-  }
-  else {
-    string FactoryServer = theComputer ;
-    if ( pyCont ) {
-      FactoryServer += "/FactoryServerPy" ;
-    }
-    else {
-      FactoryServer += "/FactoryServer" ;
-    }
-    aFactoryServer = FindContainer( FactoryServer.c_str() ) ;
-    if ( CORBA::is_nil( aFactoryServer ) ) {
-// rsh -n ikkyo /export/home/rahuel/SALOME_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515 &
-      string rsh( "" ) ;
-      if ( theComputer!= GetHostname() ) {
-        rsh += "rsh -n " ;
-        rsh += theComputer ;
-        rsh += " " ;
-      }
-      string path = ComputerPath( theComputer.c_str() ) ;
-      SCRUTE( path ) ;
-      if ( path[0] != '\0' ) {
-        rsh += path ;
-        rsh += "/../bin/" ;
-      }
-      rsh += "runSession " ;
-      if ( pyCont ) {
-        rsh += "SALOME_ContainerPy.py " ;
-        rsh += "FactoryServerPy -" ;
-      }
-      else {
-        rsh += "SALOME_Container " ;
-        rsh += "FactoryServer -" ;
-      }
-      string omniORBcfg( getenv( "OMNIORB_CONFIG" ) ) ;
-      ifstream omniORBfile( omniORBcfg.c_str() ) ;
-      char ORBInitRef[12] ;
-      char nameservice[132] ;
-      omniORBfile >> ORBInitRef ;
-      rsh += ORBInitRef ;
-      rsh += " " ;
-      omniORBfile >> nameservice ;
-      omniORBfile.close() ;
-      char * bsn = strchr( nameservice , '\n' ) ;
-      if ( bsn ) {
-        bsn[ 0 ] = '\0' ;
-      }
-      rsh += nameservice ;
-      if ( pyCont ) {
-        rsh += " > /tmp/FactoryServerPy_" ;
-      }
-      else {
-        rsh += " > /tmp/FactoryServer_" ;
-      }
-      rsh += theComputer ;
-      rsh += ".log 2>&1 &" ;
-      SCRUTE( rsh );
-      int status = system( rsh.c_str() ) ;
-      if (status == -1) {
-        MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status -1)") ;
-      }
-      else if (status == 217) {
-        MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status 217)") ;
-      }
-      else {
-        int count = 21 ;
-        while ( CORBA::is_nil( aFactoryServer ) && count ) {
-          sleep( 1 ) ;
-          count-- ;
-          if ( count != 10 )
-            MESSAGE( count << ". Waiting for FactoryServer on " << theComputer)
-          aFactoryServer = FindContainer( FactoryServer.c_str() ) ;
-       }
-        if ( CORBA::is_nil( aFactoryServer ) ) {
-          MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed") ;
-       }
-        else if ( strcmp( theComputer.c_str() , GetHostname().c_str() ) ) {
-          _FactoryServer = aFactoryServer ;
-       }
-      }
-    }
-    if ( !CORBA::is_nil( aFactoryServer ) ) {
-      if ( strcmp( theContainer.c_str() , "FactoryServer" ) ||
-           strcmp( theContainer.c_str() , "FactoryServerPy" ) ) {
-        MESSAGE("Container not found ! trying to start " << aComputerContainer);
-        Engines::Container_var myContainer = aFactoryServer->start_impl( theContainer.c_str() ) ;
-        if ( !CORBA::is_nil( myContainer ) ) {
-          MESSAGE("Container " << aComputerContainer << " started");
-          return myContainer ;
-        }
-        else {
-          MESSAGE("Container " << aComputerContainer << " NOT started");
-        }
-      }
-      else {
-        MESSAGE("Container " << aComputerContainer << " started");
-        return aFactoryServer ;
-      }
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const MachineParameters& params,
+                                                                  const char *componentName)
+{
+  MachineList_var listOfMachine=_ContManager->GetResourcesFitting(params,componentName);
+  Engines::Component_ptr ret=DoesExistComponent(componentName,params.container_name,listOfMachine);
+  if(CORBA::is_nil(ret))
+    {
+      Engines::Container_var cont=_ContManager->FindOrStartContainer(params.container_name,listOfMachine);
+      string implementation=Engines_Component_i::GetDynLibraryName(componentName);
+      return cont->load_impl(componentName, implementation.c_str());
     }
-  }
-  return Engines::Container::_nil();
+  else
+    return ret;
 }
 
-Engines::Component_var SALOME_LifeCycleCORBA::FindOrLoad_Component
-                                   (const char *containerName,
-                                   const char *componentName,
-                                   const char *implementation)
+Engines::Component_ptr SALOME_LifeCycleCORBA::DoesExistComponent(const char *componentName,
+                                                                const char *containerName,
+                                                                const MachineList& listOfMachines)
 {
-  BEGIN_OF("FindOrLoad_Component(1)");
-  ASSERT(_NS != NULL);
-  string theComputer ;
-  string theContainer ;
-  string theComputerContainer = ContainerName( containerName ,
-                                               &theComputer ,
-                                               &theContainer ) ;
-  Engines::Container_var cont = FindOrStartContainer( theComputerContainer ,
-                                                      theComputer ,
-                                                      theContainer ) ;
-//  ASSERT(!CORBA::is_nil(cont));
-
-  string path( theComputerContainer );
-  path = path + "/";
-  path = path + componentName;
-  SCRUTE(path);
-  try
+  if(containerName[0]!='\0')
     {
-      CORBA::Object_var obj = _NS->Resolve(path.c_str());
-      if (CORBA::is_nil(obj))
+      MachineList_var machinesOK=new MachineList;
+      unsigned int lghtOfmachinesOK=0;
+      machinesOK->length(listOfMachines.length());
+      for(unsigned int i=0;i<listOfMachines.length();i++)
        {
-         MESSAGE("Component not found ! trying to load " << path);
-         Engines::Component_var compo 
-           = cont->load_impl(componentName, implementation);
-//       ASSERT(!CORBA::is_nil(compo));
-         MESSAGE("Component launched !" << path);
-         return compo;
-       }
-      else
-       {
-         MESSAGE("Component found !" << path);
-         Engines::Component_var compo = Engines::Component::_narrow(obj);
-//       ASSERT(!CORBA::is_nil(compo));
-         try
-           {
-             compo->ping(); 
-           }
-         catch (CORBA::COMM_FAILURE&)
+         const char *currentMachine=listOfMachines[i];
+         string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,currentMachine);
+         CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
+         if(!CORBA::is_nil(obj))
            {
-             INFOS("Caught CORBA::SystemException CommFailure. Engine "
-                   << path << "does not respond" );
+             machinesOK[lghtOfmachinesOK++]=CORBA::string_dup(currentMachine);
            }
-         return compo;
        }
-    }
-  catch (ServiceUnreachable&)
-    {
-      INFOS("Caught exception: Naming Service Unreachable");
-    }
-  catch (...)
-    {
-      INFOS("Caught unknown exception.");
-    }
-  return Engines::Component::_nil();
-}
-
-Engines::Component_var SALOME_LifeCycleCORBA::FindOrLoad_Component
-                                  (const char *containerName,
-                                  const char *componentName)
-{
-//  BEGIN_OF("FindOrLoad_Component(2)");
-  ASSERT(_NS != NULL);
-  string theComputer ;
-  string theContainer ;
-  string theComputerContainer = ContainerName( containerName ,
-                                               &theComputer ,
-                                               &theContainer ) ;
-  Engines::Container_var cont = FindOrStartContainer( theComputerContainer ,
-                                                      theComputer ,
-                                                      theContainer ) ;
-
-  if ( CORBA::is_nil( cont ) ) {
-    MESSAGE("Container not found ! " << theComputerContainer );
-    return Engines::Component::_nil();
-  }
-
-//  char * machine = cont->machineName() ;
-  const char * machine = theComputer.c_str() ;
-
-  string path( theComputerContainer );
-  path += "/";
-  path += componentName;
-  SCRUTE(path);
-
-  try {
-    CORBA::Object_var obj = _NS->Resolve(path.c_str());
-    if ( CORBA::is_nil( obj ) ) {
-      MESSAGE("Component not found ! trying to load " << path);
-         CORBA::Object_var obj2 = _NS->Resolve("/Kernel/ModulCatalog");
-         SALOME_ModuleCatalog::ModuleCatalog_var Catalog = 
-           SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj2);
-
-         SALOME_ModuleCatalog::Acomponent_ptr compoInfo = 
-           Catalog->GetComponent(componentName);
-         if (CORBA::is_nil (compoInfo)) 
-           {
-             INFOS("Catalog Error : Component not found in the catalog")
-              return Engines::Component::_nil();
-//             exit (-1);
-           }
-         
-         string  path;
-         try
-           {
-             path = compoInfo->GetPathPrefix( machine ) ;
-              path += "/" ;
-           }
-         catch (SALOME_ModuleCatalog::NotFound&)
-           {
-             INFOS("GetPathPrefix(" << machine << ") not found!"
-                     << "trying localhost");
-             try {
-                path = compoInfo->GetPathPrefix("localhost") ;
-                path += "/" ;
-             }
-             catch (SALOME_ModuleCatalog::NotFound&) {
-               INFOS("GetPathPrefix(localhost) not found!") ;
-                path = "" ;
-             }
-           }
-
-         SCRUTE(path); 
-         string implementation(path);
-         implementation += "lib";
-         implementation += componentName;
-         implementation += "Engine.so";
-         
-         Engines::Component_var compo 
-           = cont->load_impl(componentName, implementation.c_str());
-
-//       ASSERT(!CORBA::is_nil(compo));
-//       MESSAGE("Component launched !" << path);
-         return compo;
-    }
-    else
+      if(lghtOfmachinesOK!=0)
        {
-         MESSAGE("Component found !" << path);
-         Engines::Component_var compo = Engines::Component::_narrow(obj);
-//       ASSERT(!CORBA::is_nil(compo));
-         try
-           {
-             string instanceName = compo->instanceName(); 
-           }
-         catch (CORBA::COMM_FAILURE&)
-           {
-             INFOS("Caught CORBA::SystemException CommFailure. Engine "
-                   << path << "does not respond" );
-           }
-         return compo;
+         machinesOK->length(lghtOfmachinesOK);
+         CORBA::String_var bestMachine=_ContManager->FindBest(machinesOK);
+         string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
+         CORBA::Object_var obj=_NS->Resolve(componentNameForNS.c_str());
+         return Engines::Component::_narrow(obj);
        }
+      else
+       return Engines::Component::_nil();
     }
-  catch (ServiceUnreachable&)
-    {
-      INFOS("Caught exception: Naming Service Unreachable");
-    }
-  catch (...)
+  else
     {
-      INFOS("Caught unknown exception.");
+      //user specified no container name so trying to find a component in the best machine among listOfMachines
+      CORBA::String_var bestMachine=_ContManager->FindBest(listOfMachines);
+      //Normally look at all containers launched on bestMachine to see if componentName is already launched on one of them. To do..
+      string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
+      CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
+      return Engines::Component::_narrow(obj);
     }
-  return Engines::Component::_nil();
 }
index 23b4e8797bd0ac4ed8b2b532f8fc9e8ff61dd855..a9403513670b7e0b7b2525c79907a5df7faca599 100644 (file)
@@ -34,6 +34,7 @@
 #include <string>
 
 #include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 
 class SALOME_NamingService;
@@ -41,29 +42,24 @@ class SALOME_NamingService;
 class SALOME_LifeCycleCORBA
 {
 public:
-  SALOME_LifeCycleCORBA();
   SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
   virtual ~SALOME_LifeCycleCORBA();
-
-  Engines::Container_var FindContainer(const char *containerName);
-  Engines::Component_var FindOrLoad_Component(const char *containerName,
-                                             const char *componentName,
-                                             const char *implementationPath);
-  Engines::Component_var FindOrLoad_Component(const char *containerName,
+  Engines::Component_ptr FindOrLoad_Component(const MachineParameters& params,
+                                             const char *componentName);
+  Engines::Component_ptr FindOrLoad_Component(const char *containerName,
                                              const char *componentName);
 protected:
+  Engines::Component_ptr DoesExistComponent(const char *componentName,
+                                           const char *containerName,
+                                           const MachineList& listOfMachines);
   SALOME_NamingService *_NS;
-  Engines::Container_var _FactoryServer ;
-
+  Engines::ContainerManager_var _ContManager;
+  
   //private:
   std::string ContainerName( const char * aComputerContainer ,
-                        std::string * theComputer ,
-                        std::string * theContainer ) ;
+                            std::string * theComputer ,
+                            std::string * theContainer ) ;
   std::string ComputerPath( const char * theComputer ) ;
-  Engines::Container_var FindOrStartContainer(const std::string aComputerContainer ,
-                                              const std::string theComputer ,
-                                              const std::string theContainer ) ;
-
 } ;
 
 #endif
index 55719f6e8d425db34c6c5b4e1dea1da7e72c4ee5..669b4f8ca86174f7829be40863f46c062f180205 100644 (file)
@@ -39,6 +39,7 @@ LIB_MOC = \
 LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_ModuleCatalog.idl \
                 SALOME_Component.idl \
+                SALOME_ContainerManager.idl \
                 SALOME_Exception.idl
 
 
index 375a786b08b215df5467908c2bee466a19546172..ca9f91bf11bcd8b6c059126c732e2fcd9ebf2f20 100644 (file)
@@ -43,6 +43,7 @@ LIB_MOC = \
 LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_ModuleCatalog.idl \
                 SALOME_Component.idl \
+                SALOME_ContainerManager.idl \
                 SALOME_Exception.idl
 
 CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(OGL_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES)