Salome HOME
Porting to Mandrake 10.1 and new products:
[modules/kernel.git] / src / LifeCycleCORBA / SALOME_LifeCycleCORBA.hxx
1 //  SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_LifeCycleCORBA.hxx
25 //  Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef _SALOME_LIFECYCLECORBA_HXX_
30 #define _SALOME_LIFECYCLECORBA_HXX_
31
32 #include <stdlib.h>
33 #include <unistd.h>
34 #include <string>
35
36 #include <SALOMEconfig.h>
37 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
38 #include CORBA_CLIENT_HEADER(SALOME_Component)
39
40 class SALOME_NamingService;
41
42 class SALOME_LifeCycleCORBA
43 {
44 public:
45   SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
46   virtual ~SALOME_LifeCycleCORBA();
47   Engines::Container_ptr FindContainer(const char *containerName); // for supervision
48   Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params,
49                                               const char *componentName);
50   Engines::Component_ptr FindOrLoad_Component(const char *containerName,
51                                               const char *componentName);
52   bool isKnownComponentClass(const char *componentName);
53 protected:
54   //! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources
55   //! in "listOfMachines". This method uses Naming Service to find the component.
56   Engines::Component_ptr FindComponent(const char *containerName,
57                                             const char *componentName,
58                                             const Engines::MachineList& listOfMachines);
59
60   Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines);
61
62   SALOME_NamingService *_NS;
63   Engines::ContainerManager_var _ContManager;
64   
65   //private:
66   std::string ContainerName( const char * aComputerContainer ,
67                              std::string * theComputer ,
68                              std::string * theContainer ) ;
69   std::string ComputerPath( const char * theComputer ) ;
70   Engines::Container_ptr FindOrStartContainer(const std::string aComputerContainer ,
71                                               const std::string theComputer ,
72                                               const std::string theContainer ) ;
73 } ;
74
75 #endif