]> SALOME platform Git repositories - modules/kernel.git/blob - src/Container/SALOME_ContainerManagerServer.cxx
Salome HOME
Copyrights update
[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/
19 //
20 #include "SALOME_ContainerManager.hxx"
21 #include "SALOMETraceCollector.hxx"
22 #include "utilities.h"
23
24 int main(int argc, char* argv[])
25 {
26   PortableServer::POA_var root_poa;
27   PortableServer::POAManager_var pman;
28   CORBA::Object_var obj;
29
30   CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
31   //  LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
32   INFOS_COMPILATION;
33   BEGIN_OF(argv[0]);
34   try{ 
35         obj = orb->resolve_initial_references("RootPOA");
36         if(!CORBA::is_nil(obj))
37           root_poa = PortableServer::POA::_narrow(obj);
38         if(!CORBA::is_nil(root_poa))
39           pman = root_poa->the_POAManager();
40       }
41   catch(CORBA::COMM_FAILURE&){
42     MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
43   }
44   try{
45     SALOME_ContainerManager *cmServ=new SALOME_ContainerManager(orb);
46     pman->activate();
47     orb->run();
48   }catch(CORBA::SystemException&){
49     MESSAGE("Caught CORBA::SystemException.");
50   }catch(PortableServer::POA::WrongPolicy&){
51     MESSAGE("Caught CORBA::WrongPolicyException.");
52   }catch(PortableServer::POA::ServantAlreadyActive&){
53     MESSAGE("Caught CORBA::ServantAlreadyActiveException");
54   }catch(CORBA::Exception&){
55     MESSAGE("Caught CORBA::Exception.");
56   }catch(std::exception& exc){
57     MESSAGE("Caught std::exception - "<<exc.what()); 
58   }catch(...){
59     MESSAGE("Caught unknown exception.");
60   }
61   END_OF(argv[0]);
62   //  delete myThreadTrace;
63 }
64