]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: add FindContainer method for supervisor (non regression)
authorprascle <prascle>
Mon, 24 Jan 2005 16:25:49 +0000 (16:25 +0000)
committerprascle <prascle>
Mon, 24 Jan 2005 16:25:49 +0000 (16:25 +0000)
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx

index d846594ab4f36f81bd135c075a4973128059ff54..744229cc7a940a08182a8a774ed36660a9133a01 100644 (file)
@@ -134,6 +134,36 @@ string SALOME_LifeCycleCORBA::ComputerPath(
   return CORBA::string_dup( path ) ;
 }
 
+Engines::Container_ptr 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 ) ;
+    }
+  }
+  catch (ServiceUnreachable&) {
+    INFOS("Caught exception: Naming Service Unreachable");
+  }
+  catch (...) {
+    INFOS("Caught unknown exception.");
+  }
+  return Engines::Container::_nil();
+}
+
 Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component
                                   (const char *containerName,
                                   const char *componentName)
index 249d4c0aa82e2268be516d3d0c74a746db4face2..a7a145c275a62210785d33b4b8bea543b758967b 100644 (file)
@@ -44,6 +44,7 @@ class SALOME_LifeCycleCORBA
 public:
   SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
   virtual ~SALOME_LifeCycleCORBA();
+  Engines::Container_ptr FindContainer(const char *containerName); // for supervision
   Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params,
                                              const char *componentName);
   Engines::Component_ptr FindOrLoad_Component(const char *containerName,