diff options
author | msmit <msmit@remedy.nl> | 2012-06-27 12:46:22 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2012-06-27 12:46:22 +0000 |
commit | 13f0096ec0cd05f99acf5a8728202c7ff15bd17a (patch) | |
tree | 95e762197ea88130086593ae1237d973ba8b3741 /CIAO/connectors/dds4ccm/tests | |
parent | 601f880a1d2f7daeb0dec87b689bc81e3cc283ee (diff) | |
download | ATCD-13f0096ec0cd05f99acf5a8728202c7ff15bd17a.tar.gz |
Wed Jun 27 12:45:56 UTC 2012 Marcel Smit <msmit@remedy.nl>
* connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl:
* connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h:
* connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp:
* connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp:
Start the writing of samples upon a publication matched event.
Diffstat (limited to 'CIAO/connectors/dds4ccm/tests')
4 files changed, 140 insertions, 17 deletions
diff --git a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl index b3b7f8c1ff6..2c5ea40d150 100644 --- a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl +++ b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl @@ -14,6 +14,7 @@ module LNE_Test component Sender { port ListenNotEnabledTestConnector::DDS_Write info_write; + provides CCM_DDS::ConnectorStatusListener connector_status; attribute unsigned short keys; attribute unsigned short iterations; diff --git a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp index 7e6900ee192..f3c045718d0 100644 --- a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp +++ b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp @@ -32,6 +32,63 @@ namespace CIAO_LNE_Test_Sender_Impl { /** + * ConnectorStatusListener_exec_i + */ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Sender_exec_i &callback) + : callback_ (callback) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind status_kind) + { + if (status_kind == ::DDS::PUBLICATION_MATCHED_STATUS) + { + ACE_DEBUG ((LM_DEBUG, "ConnectorStatusListener_exec_i::on_unexpected_status - " + "Publication matched received: starting the test\n")); + + this->callback_.get_started (); + } + } + + /** * WriteHandler */ @@ -88,6 +145,12 @@ namespace CIAO_LNE_Test_Sender_Impl return reactor; } + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (*this); + } + void Sender_exec_i::write_many (void) { @@ -125,6 +188,25 @@ namespace CIAO_LNE_Test_Sender_Impl } } + void + Sender_exec_i::get_started (void) + { + try + { + this->start (); + } + catch (const ::CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Exception caught\n"))); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Unknown exception caught\n"))); + } + } void Sender_exec_i::start (void) @@ -184,21 +266,6 @@ namespace CIAO_LNE_Test_Sender_Impl void Sender_exec_i::ccm_activate (void) { - try - { - start (); - } - catch (const ::CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught:"); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Exception caught\n"))); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Unknown exception caught\n"))); - } } void diff --git a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h index 59a455b4415..c6389141a3a 100644 --- a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h +++ b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h @@ -43,6 +43,39 @@ namespace CIAO_LNE_Test_Sender_Impl class Sender_exec_i; /** + * ConnectorStatusListener_exec_i + */ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Sender_exec_i &callback); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Sender_exec_i &callback_; + }; + + /** * WriteHandler */ @@ -75,6 +108,8 @@ namespace CIAO_LNE_Test_Sender_Impl //@{ /** Component attributes and port operations. */ + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); virtual ::CORBA::UShort keys (void); @@ -96,7 +131,7 @@ namespace CIAO_LNE_Test_Sender_Impl //@{ /** User defined public operations. */ - void start (void); + void get_started (void); void write_many (void); //@} @@ -119,7 +154,7 @@ namespace CIAO_LNE_Test_Sender_Impl //@{ /** User defined private operations. */ - + void start (void); //@} /// Get the ACE_Reactor diff --git a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp index 88c969df2fa..f750e49c467 100644 --- a/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp +++ b/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp @@ -294,6 +294,26 @@ </internalEndpoint> </connection> + <connection> + <name>connector_status_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="LNE_Test_ConnectorComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + </connection> + <artifact xmi:id="Sender_ExecArtifact"> <name>Sender_exec</name> <source/> |