int setup (CORBA::ORB_ptr orb, FT_Naming::NamingManager_ptr nm) { if (group_svc.set_orb (orb) != 0 || group_svc.set_naming_manager (nm)) { ACE_DEBUG ((LM_DEBUG, "Hammer setup failed\n")); return -1; } return 0; }
int NSGROUP::start_orb (void) { const int RC_SUCCESS = 0; const int RC_ERROR = -1; try { #if 0 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("start_orb::argc(%u)\n"), this->argc_)); for( int i = 0; i < this->argc_; ++i){ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("start_orb::argv(%u:%s)\n"), i, this->argv_[i])); } #endif // // Initialise the ORB. CORBA::ORB_var orb_ = CORBA::ORB_init (this->argc_, this->argv_); if (RC_SUCCESS != svc_.set_orb (orb_.in ())) { ACE_ERROR_RETURN (( LM_ERROR, ACE_TEXT (" (%P|%t) Unable to initialize the ORB.\n")), RC_ERROR); } ////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////// CORBA::Object_var naming_manager_object = orb_->resolve_initial_references ("NamingManager"); FT_Naming::NamingManager_var naming_manager_ = FT_Naming::NamingManager::_narrow (naming_manager_object.in ()); if (RC_SUCCESS != svc_.set_naming_manager (naming_manager_.in ())) { ACE_ERROR_RETURN (( LM_ERROR, ACE_TEXT (" (%P|%t) Unable to get Naming ") ACE_TEXT ("Manager Reference\n")), RC_ERROR); } ////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////// CORBA::Object_var naming_object = orb_->resolve_initial_references("NameService"); CosNaming::NamingContextExt_var name_service_ = CosNaming::NamingContextExt::_narrow (naming_object.in ()); if (RC_SUCCESS != svc_.set_name_context (name_service_.in ())) { ACE_ERROR_RETURN (( LM_ERROR, ACE_TEXT (" (%P|%t) Unable to get Name Service ") ACE_TEXT ("Reference\n")), RC_ERROR); } ////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////// } catch (const CORBA::Exception& ex) { ex._tao_print_exception (ACE_TEXT("\nException raised initialising ORB\n")); return RC_ERROR; } return RC_SUCCESS; }