From 88f12a4d77adda2b070e0273d4e7ff8011ddf8f5 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 25 Feb 2005 14:35:37 +0000 Subject: [PATCH] Server only present for ContainerManager servant. --- .../SALOME_ContainerManagerServer.cxx | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Container/SALOME_ContainerManagerServer.cxx diff --git a/src/Container/SALOME_ContainerManagerServer.cxx b/src/Container/SALOME_ContainerManagerServer.cxx new file mode 100644 index 000000000..b8ab6c041 --- /dev/null +++ b/src/Container/SALOME_ContainerManagerServer.cxx @@ -0,0 +1,40 @@ +#include "SALOME_ContainerManager.hxx" +#include "utilities.h" + +int main(int argc, char* argv[]) +{ + PortableServer::POA_var root_poa; + PortableServer::POAManager_var pman; + CORBA::Object_var obj; + + CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ; + try{ + obj = orb->resolve_initial_references("RootPOA"); + if(!CORBA::is_nil(obj)) + root_poa = PortableServer::POA::_narrow(obj); + if(!CORBA::is_nil(root_poa)) + pman = root_poa->the_POAManager(); + } + catch(CORBA::COMM_FAILURE&){ + MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + } + try{ + SALOME_ContainerManager *cmServ=new SALOME_ContainerManager(orb); + cmServ->_this(); + pman->activate(); + orb->run(); + }catch(CORBA::SystemException&){ + MESSAGE("Caught CORBA::SystemException."); + }catch(PortableServer::POA::WrongPolicy&){ + MESSAGE("Caught CORBA::WrongPolicyException."); + }catch(PortableServer::POA::ServantAlreadyActive&){ + MESSAGE("Caught CORBA::ServantAlreadyActiveException"); + }catch(CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + }catch(std::exception& exc){ + MESSAGE("Caught std::exception - "<