| 788 | } |
| 789 | |
| 790 | void |
| 791 | ManagerImpl::finalize() |
| 792 | { |
| 793 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 794 | ACE_DEBUG((LM_DEBUG, |
| 795 | ACE_TEXT("(%P|%t) Federator::ManagerImpl::finalize()\n"))); |
| 796 | } |
| 797 | |
| 798 | ownerListener_.stop(); |
| 799 | topicListener_.stop(); |
| 800 | participantListener_.stop(); |
| 801 | publicationListener_.stop(); |
| 802 | subscriptionListener_.stop(); |
| 803 | ownerListener_.join(); |
| 804 | topicListener_.join(); |
| 805 | participantListener_.join(); |
| 806 | publicationListener_.join(); |
| 807 | subscriptionListener_.join(); |
| 808 | |
| 809 | if (this->federated_) { |
| 810 | try { |
| 811 | IdToManagerMap::iterator where = this->peers_.find(this->joinRepo_); |
| 812 | |
| 813 | if (where == this->peers_.end()) { |
| 814 | ACE_DEBUG((LM_DEBUG, |
| 815 | ACE_TEXT("(%P|%t) Federator::Manager::finalize: ") |
| 816 | ACE_TEXT("repository %d - all attachment to federation left.\n"), |
| 817 | this->id().id())); |
| 818 | |
| 819 | } else { |
| 820 | if (CORBA::is_nil(where->second.in())) { |
| 821 | ACE_ERROR((LM_ERROR, |
| 822 | ACE_TEXT("(%P|%t) ERROR: Federator::Manager::finalize: ") |
| 823 | ACE_TEXT("repository %d not currently attached to a federation.\n"), |
| 824 | this->id().id())); |
| 825 | |
| 826 | } else { |
| 827 | where->second->leave_federation(this->id().id()); |
| 828 | this->federated_ = false; |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | } catch (const CORBA::Exception& ex) { |
| 833 | ex._tao_print_exception( |
| 834 | ACE_TEXT("ERROR: Federator::ManagerImpl::finalize() - ") |
| 835 | ACE_TEXT("unable to leave remote federation ")); |
| 836 | throw Incomplete(); |
| 837 | } |
| 838 | } |
| 839 | |
| 840 | if (!CORBA::is_nil(this->orb_.in()) && (0 != this->orb_->orb_core())) { |
| 841 | this->orb_->orb_core()->reactor()->remove_handler( |
| 842 | &this->multicastResponder_, |
| 843 | ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); |
| 844 | } |
| 845 | |
| 846 | // Remove our local participant and contained entities. |
| 847 | if (federationParticipant_) { |
nothing calls this directly
no test coverage detected