MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / join_federation

Method join_federation

dds/InfoRepo/FederatorManagerImpl.cpp:919–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

917}
918
919Manager_ptr
920ManagerImpl::join_federation(
921 Manager_ptr peer,
922 FederationDomain federation
923)
924{
925 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
926 ACE_DEBUG((LM_DEBUG,
927 ACE_TEXT("(%P|%t) ManagerImpl::join_federation( peer, %d)\n"),
928 federation));
929 }
930
931 RepoKey remote = NIL_REPOSITORY;
932
933 try {
934 // Obtain the remote repository federator Id value.
935 remote = peer->federation_id();
936
937 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
938 ACE_DEBUG((LM_DEBUG,
939 ACE_TEXT("(%P|%t) Federator::ManagerImpl::join_federation() - ")
940 ACE_TEXT("repo id %d entered from repository with id %d.\n"),
941 this->id().id(),
942 remote));
943 }
944
945 } catch (const CORBA::Exception& ex) {
946 ex._tao_print_exception(
947 ACE_TEXT("ERROR: Federator::ManagerImpl::join_federation() - ")
948 ACE_TEXT("unable to obtain remote federation Id value: "));
949 throw Incomplete();
950 }
951
952 // If we are recursing, then we are done.
953 if (this->joiner_ == remote) {
954 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
955 ACE_DEBUG((LM_DEBUG,
956 ACE_TEXT("(%P|%t) Federator::ManagerImpl::join_federation() - ")
957 ACE_TEXT("repo id %d leaving after reentry from repository with id %d.\n"),
958 this->id().id(),
959 remote));
960 }
961
962 return this->_this();
963
964 } else {
965 // Block while any different repository is joining.
966 ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, guard, this->lock_, 0);
967
968 while (this->joiner_ != NIL_REPOSITORY) {
969 // This releases the lock while we block.
970 this->joining_.wait();
971
972 // We are now recursing - curses!
973 if (this->joiner_ == remote) {
974 return this->_this();
975 }
976 }

Callers 2

ACE_TMAINFunction · 0.80
initMethod · 0.80

Calls 15

pushStateMethod · 0.95
initializeMethod · 0.95
federation_idMethod · 0.80
_tao_print_exceptionMethod · 0.80
repositoryMethod · 0.80
object_to_stringMethod · 0.80
federationDomainMethod · 0.80
idMethod · 0.45
waitMethod · 0.45
_get_orbMethod · 0.45
inMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected