summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/impl/ndds
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-02-11 11:33:12 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-02-11 11:33:12 +0000
commit4df04cc27ef1e77bcc941afaba7d4c943b98a936 (patch)
tree5054c2bde24d048d4790ff659b61be0838cd0d69 /CIAO/connectors/dds4ccm/impl/ndds
parentb723802f85ac66026a503827677a2fb1e9a77933 (diff)
downloadATCD-4df04cc27ef1e77bcc941afaba7d4c943b98a936.tar.gz
Fri Feb 11 11:16:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged changes from Remedy work branch.
Diffstat (limited to 'CIAO/connectors/dds4ccm/impl/ndds')
-rw-r--r--CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp48
-rw-r--r--CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory.cpp35
-rw-r--r--CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp32
-rw-r--r--CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp2
4 files changed, 89 insertions, 28 deletions
diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp
index a94a2a6a3c9..b56d64e1c0b 100644
--- a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp
+++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp
@@ -98,7 +98,18 @@ namespace CIAO
"Successfully created a DDSPublisher\n",
qos_profile));
- ccm_dds_pub->enable ();
+ DDS_ReturnCode_t retcode = ccm_dds_pub->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipant_i"
+ "::create_publisher_with_profile <%C> - "
+ "Error: Unable to create Publisher: <%C>\n",
+ qos_profile,
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_pl;
+ throw ::CORBA::INTERNAL ();
+ }
return retval._retn ();
}
@@ -149,7 +160,17 @@ namespace CIAO
"DDS_DomainParticipant_i::create_publisher - "
"Successfully created a DDSPublisher\n"));
- ccm_dds_pub->enable ();
+ DDS_ReturnCode_t retcode = ccm_dds_pub->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipant_i"
+ "::create_publisher - "
+ "Error: Unable to enable the Publisher: <%C>\n",
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_pl;
+ throw ::CORBA::INTERNAL ();
+ }
return retval._retn ();
}
@@ -252,7 +273,17 @@ namespace CIAO
"Successfully created a DDSSubscriber\n",
qos_profile));
- ccm_dds_sub->enable ();
+ DDS_ReturnCode_t retcode = ccm_dds_sub->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipant_i::create_subscriber_with_profile <%C> - "
+ "Error: Unable to enable the DDSSubscriber: <%C>\n",
+ qos_profile,
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_sl;
+ throw ::CORBA::INTERNAL ();
+ }
return retval._retn ();
}
@@ -304,7 +335,16 @@ namespace CIAO
"DDS_DomainParticipant_i::create_subscriber - "
"Successfully created a DDSSubscriber\n"));
- ccm_dds_sub->enable ();
+ DDS_ReturnCode_t retcode = ccm_dds_sub->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipant_i::create_subscriber - "
+ "Error: Unable to enable the DDSSubscriber: <%C>\n",
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_sl;
+ throw ::CORBA::INTERNAL ();
+ }
return retval._retn ();
}
diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory.cpp
index be290a1e74b..4363a03b9a1 100644
--- a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory.cpp
+++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory.cpp
@@ -67,6 +67,7 @@ namespace CIAO
"::create_participant - "
"Error: Unable to create DomainParticipant for domain <%d>\n",
domain_id));
+ delete ccm_dds_dpl;
return ::DDS::DomainParticipant::_nil ();
}
@@ -74,7 +75,19 @@ namespace CIAO
ACE_NEW_THROW_EX (retval,
DDS_DomainParticipant_i (dds_dp),
::CORBA::NO_MEMORY ());
- dds_dp->enable ();
+ DDS_ReturnCode_t retcode = dds_dp->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipantFactory_i"
+ "::create_participant - "
+ "Error: Unable to enable the domainparticipant "
+ "for domain <%d>: <%C>\n",
+ domain_id,
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_dpl;
+ throw ::CORBA::INTERNAL ();
+ }
if (ccm_dds_dpl)
{
@@ -151,16 +164,28 @@ namespace CIAO
{
DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
"DDS_DomainParticipantFactory_i::create_participant_with_profile <%C> - "
- "Error: Unable to create DomainParticipant\n",
- qos_profile));
+ "Error: Unable to create DomainParticipant for domain <%d>\n",
+ qos_profile,
+ domain_id));
+ delete ccm_dds_dpl;
return ::DDS::DomainParticipant::_nil ();
}
::DDS::DomainParticipant_var retval;
ACE_NEW_THROW_EX (retval,
DDS_DomainParticipant_i (dds_dp),
::CORBA::NO_MEMORY ());
-
- dds_dp->enable ();
+ DDS_ReturnCode_t retcode = dds_dp->enable ();
+ if (retcode != DDS_RETCODE_OK)
+ {
+ DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
+ "DDS_DomainParticipantFactory_i::create_participant_with_profile <%C> - "
+ "Error: Unable to enable DomainParticipant for domain <%d>: <%C>\n",
+ qos_profile,
+ domain_id,
+ ::CIAO::DDS4CCM::translate_retcode (retcode)));
+ delete ccm_dds_dpl;
+ throw ::CORBA::INTERNAL ();
+ }
if (ccm_dds_dpl)
{
diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp
index f26eea820a5..78e4a2e9c37 100644
--- a/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp
+++ b/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp
@@ -55,10 +55,10 @@ namespace CIAO
return ::DDS::DataWriter::_nil ();
}
- DDS_DataWriterListener_i *ccm_dds_drl = 0;
+ DDS_DataWriterListener_i *ccm_dds_dwl = 0;
if (! ::CORBA::is_nil (a_listener))
{
- ACE_NEW_THROW_EX (ccm_dds_drl,
+ ACE_NEW_THROW_EX (ccm_dds_dwl,
DDS_DataWriterListener_i (a_listener, 0),
::CORBA::NO_MEMORY ());
}
@@ -66,7 +66,7 @@ namespace CIAO
DDSDataWriter *ccm_dds_dw = this->rti_entity ()->create_datawriter (
topic->get_rti_entity (),
ccm_dds_qos,
- ccm_dds_drl,
+ ccm_dds_dwl,
mask);
if (!ccm_dds_dw)
@@ -74,18 +74,17 @@ namespace CIAO
DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_DDS_NIL_RETURN, (LM_ERROR, DDS4CCM_INFO
"DDS_Publisher_i::create_datawriter - "
"Error: RTI Topic returned a nil datawriter.\n"));
- delete ccm_dds_drl;
+ delete ccm_dds_dwl;
return ::DDS::DataWriter::_nil ();
}
- ::DDS::DataWriter_var retval = DDS_TypeSupport_i::create_datawriter (ccm_dds_dw,
+ ::DDS::DataWriter_var retval = DDS_TypeSupport_i::create_datawriter (ccm_dds_dw,
this->dp_.in (),
this);
- if (ccm_dds_drl)
- {
- ccm_dds_drl->set_dds_entity (retval.in ());
- }
- ccm_dds_dw->enable ();
+ if (ccm_dds_dwl)
+ {
+ ccm_dds_dwl->set_dds_entity (retval.in ());
+ }
return retval._retn ();
}
@@ -109,10 +108,10 @@ namespace CIAO
return ::DDS::DataWriter::_nil ();
}
- DDS_DataWriterListener_i *ccm_dds_drl = 0;
+ DDS_DataWriterListener_i *ccm_dds_dwl = 0;
if (! ::CORBA::is_nil (a_listener))
{
- ACE_NEW_THROW_EX (ccm_dds_drl,
+ ACE_NEW_THROW_EX (ccm_dds_dwl,
DDS_DataWriterListener_i (a_listener, 0),
::CORBA::NO_MEMORY ());
}
@@ -124,7 +123,7 @@ namespace CIAO
topic->get_rti_entity (),
lib_name,
prof_name,
- ccm_dds_drl,
+ ccm_dds_dwl,
mask);
ACE_OS::free (lib_name);
ACE_OS::free (prof_name);
@@ -135,7 +134,7 @@ namespace CIAO
"DDS_Publisher_i::create_datawriter_with_profile <%C> - "
"Error: RTI Topic returned a nil datawriter.\n",
qos_profile));
- delete ccm_dds_drl;
+ delete ccm_dds_dwl;
return ::DDS::DataWriter::_nil ();
}
else
@@ -150,11 +149,10 @@ namespace CIAO
DDS_TypeSupport_i::create_datawriter (ccm_dds_dw,
this->dp_.in (),
this);
- if (ccm_dds_drl)
+ if (ccm_dds_dwl)
{
- ccm_dds_drl->set_dds_entity (retval.in ());
+ ccm_dds_dwl->set_dds_entity (retval.in ());
}
- ccm_dds_dw->enable ();
return retval._retn ();
}
diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp
index 4cd72de9ebc..1f623a56194 100644
--- a/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp
+++ b/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp
@@ -202,7 +202,6 @@ namespace CIAO
"Successfully created datareader.\n"));
}
- ccm_dds_dr->enable ();
::DDS::DataReader_var reader = DDS_TypeSupport_i::create_datareader (
ccm_dds_dr,
this->dp_.in (),
@@ -288,7 +287,6 @@ namespace CIAO
{
ccm_dds_drl->set_dds_entity (reader.in ());
}
- ccm_dds_dr->enable ();
return reader._retn ();
}