Back to index

salome-kernel  6.5.0
Functions
SALOME_ConnectionManagerServer.cxx File Reference
#include "ConnectionManager_i.hxx"
#include "utilities.h"
#include <iostream>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 31 of file SALOME_ConnectionManagerServer.cxx.

{
  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();

    // We create a ConnectionManager.
    // It is automatically added to the RootPOA into its constructor.
    new ConnectionManager_i(orb);

    pman->activate();
    orb->run();
    orb->destroy();
  }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 - "<<exc.what()); 
  }catch(...){
    MESSAGE("Caught unknown exception.");
  }
  END_OF(argv[0]);
}