| 154 | } |
| 155 | |
| 156 | void |
| 157 | Monitor::MonitorTask::stopInstrumentation() |
| 158 | { |
| 159 | // Only shutdown if we are currently actively processing data from a |
| 160 | // repository. |
| 161 | if( CORBA::is_nil( this->participant_.in())) { |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | ACE_DEBUG((LM_DEBUG, |
| 166 | ACE_TEXT("(%P|%t) MonitorTask::stopInstrumentation() - ") |
| 167 | ACE_TEXT("removing participant for domain %d.\n"), |
| 168 | this->participant_->get_domain_id() |
| 169 | )); |
| 170 | |
| 171 | ACE_GUARD(ACE_SYNCH_MUTEX, guard, this->lock_); |
| 172 | |
| 173 | // Clean up the wait conditions. |
| 174 | DDS::ConditionSeq conditions; |
| 175 | this->waiter_->get_conditions( conditions); |
| 176 | this->waiter_->detach_conditions( conditions); |
| 177 | |
| 178 | // Reattach the guard condition. |
| 179 | this->waiter_->attach_condition( this->guardCondition_); |
| 180 | |
| 181 | // Terminate the transport resources. |
| 182 | |
| 183 | // It is possible that the repository was down at this point, |
| 184 | // and we do not want the exception stop the monitor process |
| 185 | // so catch exception here. |
| 186 | try { |
| 187 | // Destroy the instrumentation participant. |
| 188 | this->participant_->delete_contained_entities(); |
| 189 | TheParticipantFactory->delete_participant( this->participant_.in()); |
| 190 | } |
| 191 | catch (const CORBA::TRANSIENT&) |
| 192 | { |
| 193 | ACE_DEBUG((LM_DEBUG, |
| 194 | ACE_TEXT("(%P|%t) MonitorTask::stopInstrumentation() - ") |
| 195 | ACE_TEXT("caught TRANSIENT exception.\n") |
| 196 | )); |
| 197 | } |
| 198 | catch (const CORBA::Exception& ex) { |
| 199 | ex._tao_print_exception("(%P|%t) MonitorTask::stopInstrumentation() - "); |
| 200 | throw; |
| 201 | } |
| 202 | catch (...) { |
| 203 | throw; |
| 204 | } |
| 205 | |
| 206 | this->participant_ = DDS::DomainParticipant::_nil(); |
| 207 | } |
| 208 | |
| 209 | Monitor::MonitorTask::RepoKey |
| 210 | Monitor::MonitorTask::setRepoIor( const std::string& ior) |
no test coverage detected