Salome HOME
PR: from Sergey Mozokhin, Supervisor problem, crash after killing a dataflow execution.
[modules/kernel.git] / src / Container / SALOME_ContainerManagerServer.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
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.
8 // 
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.
13 //
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
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #include "SALOME_ContainerManager.hxx"
21 #include "utilities.h"
22
23 int main(int argc, char* argv[])
24 {
25   PortableServer::POA_var root_poa;
26   PortableServer::POAManager_var pman;
27   CORBA::Object_var obj;
28
29   CORBA::ORB_ptr orb = CORBA::ORB_init( argc , argv ) ;
30   //  LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
31   INFOS_COMPILATION;
32   BEGIN_OF(argv[0]);
33   try{ 
34         obj = orb->resolve_initial_references("RootPOA");
35         if(!CORBA::is_nil(obj))
36           root_poa = PortableServer::POA::_narrow(obj);
37         if(!CORBA::is_nil(root_poa))
38           pman = root_poa->the_POAManager();
39       }
40   catch(CORBA::COMM_FAILURE&){
41     MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
42   }
43   try{
44     SALOME_ContainerManager *cmServ=new SALOME_ContainerManager(orb);
45     pman->activate();
46     orb->run();
47   }catch(CORBA::SystemException&){
48     MESSAGE("Caught CORBA::SystemException.");
49   }catch(PortableServer::POA::WrongPolicy&){
50     MESSAGE("Caught CORBA::WrongPolicyException.");
51   }catch(PortableServer::POA::ServantAlreadyActive&){
52     MESSAGE("Caught CORBA::ServantAlreadyActiveException");
53   }catch(CORBA::Exception&){
54     MESSAGE("Caught CORBA::Exception.");
55   }catch(std::exception& exc){
56     MESSAGE("Caught std::exception - "<<exc.what()); 
57   }catch(...){
58     MESSAGE("Caught unknown exception.");
59   }
60   END_OF(argv[0]);
61   //  delete myThreadTrace;
62 }
63