1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __SALOME_CONTAINERMANAGER_HXX__
21 #define __SALOME_CONTAINERMANAGER_HXX__
23 #include <SALOME_Container.hxx>
25 #include <SALOMEconfig.h>
26 #include CORBA_CLIENT_HEADER(SALOME_Component)
27 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
28 #include "SALOME_ResourcesManager.hxx"
29 #include "SALOME_LoadRateManager.hxx"
33 class SALOME_NamingService;
35 class CONTAINER_EXPORT SALOME_ContainerManager:
36 public POA_Engines::ContainerManager
40 SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_ResourcesManager *rm, SALOME_NamingService *ns);
41 ~SALOME_ContainerManager();
43 Engines::Container_ptr
44 FindOrStartContainer(const Engines::MachineParameters& params,
45 const Engines::MachineList& possibleComputer);
47 Engines::Container_ptr
48 StartContainer(const Engines::MachineParameters& params,
49 const Engines::MachineList& possibleComputer,
50 Engines::ResPolicy policy);
52 Engines::Container_ptr
53 StartContainer(const Engines::MachineParameters& params,
54 Engines::ResPolicy policy,
55 const Engines::CompoList& componentList);
57 Engines::Container_ptr
58 GiveContainer(const Engines::MachineParameters& params,
59 Engines::ResPolicy policy,
60 const Engines::CompoList& componentList);
63 void ShutdownWithExit();
64 void ShutdownContainers();
68 static const char *_ContainerManagerNameInNS;
71 Engines::Container_ptr
72 FindOrStartParallelContainer(const Engines::MachineParameters& params,
73 const Engines::MachineList& possibleComputer);
75 Engines::Container_ptr
76 FindContainer(const Engines::MachineParameters& params,
77 const Engines::MachineList& possibleComputers);
79 Engines::Container_ptr
80 FindContainer(const Engines::MachineParameters& params,
81 const char *theMachine);
85 LaunchParallelContainer(const std::string& command,
86 const Engines::MachineParameters& params,
87 const std::string& name);
89 void fillBatchLaunchedContainers();
91 long GetIdForContainer(void);
94 PortableServer::POA_var _poa;
96 SALOME_ResourcesManager *_ResManager;
97 SALOME_NamingService *_NS;
98 static std::vector<Engines::Container_ptr> _batchLaunchedContainers;
99 static std::vector<Engines::Container_ptr>::iterator _batchLaunchedContainersIter;