summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-12-08 14:31:16 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-12-08 14:31:16 +0000
commita40f19402b986bf4f30a664dad092b604808b246 (patch)
treec8f2922e9465ffd2138da12ae0684f85a71325d2
parent3c2e72da953a3cfa273b3695fd1898a7527421d4 (diff)
downloadATCD-a40f19402b986bf4f30a664dad092b604808b246.tar.gz
Wed Dec 8 14:28:53 UTC 2010 Martin Corino <corino_m@remedy.nl>
* connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h: * connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp: Removed these files. * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc: * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h: * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp: Updated to use the new AMI reply handler executor implementation skeleton generated in de _exec.* files instead of separate _conn_i.* files.
-rw-r--r--CIAO/ChangeLog12
-rw-r--r--CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp143
-rw-r--r--CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h99
-rw-r--r--CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc2
-rw-r--r--CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp364
-rw-r--r--CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h116
6 files changed, 333 insertions, 403 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index d19f4932e0f..6764f97f26e 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,3 +1,15 @@
+Wed Dec 8 14:28:53 UTC 2010 Martin Corino <corino_m@remedy.nl>
+
+ * connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h:
+ * connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp:
+ Removed these files.
+ * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc:
+ * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h:
+ * connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp:
+ Updated to use the new AMI reply handler executor implementation
+ skeleton generated in de _exec.* files instead of separate
+ _conn_i.* files.
+
Wed Dec 8 10:59:48 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
* tools/IDL3_to_XMI/IDL3_TO_XMI.mpc:
diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp
deleted file mode 100644
index 48138de4512..00000000000
--- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// -*- C++ -*-
-// $Id$
-
-/**
- * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3
- * TAO and the TAO IDL Compiler have been developed by:
- * Center for Distributed Object Computing
- * Washington University
- * St. Louis, MO
- * USA
- * http://www.cs.wustl.edu/~schmidt/doc-center.html
- * and
- * Distributed Object Computing Laboratory
- * University of California at Irvine
- * Irvine, CA
- * USA
- * and
- * Institute for Software Integrated Systems
- * Vanderbilt University
- * Nashville, TN
- * USA
- * http://www.isis.vanderbilt.edu/
- *
- * Information about TAO is available at:
- * http://www.cs.wustl.edu/~schmidt/TAO.html
- **/
-
-// TAO_IDL - Generated from
-// be/be_codegen.cpp:1661
-
-#include "AsynchTA_conn_i.h"
-
-//original namespace name generated with -Gcn -Gex, replaced with current name
-//namespace CIAO_AsynchT_AMI4CCM_MyFoo_Connector_AMI4CCM_Connector_Impl
-namespace CIAO_AsynchT_Sender_Impl
-{
-
- AMI4CCM_MyFooReplyHandler_i::AMI4CCM_MyFooReplyHandler_i (
- Atomic_UShort &nr_of_sent,
- Atomic_UShort &nr_of_rec)
- : nr_of_sent_ (nr_of_sent),
- nr_of_rec_ (nr_of_rec)
- {
- }
-
- AMI4CCM_MyFooReplyHandler_i::~AMI4CCM_MyFooReplyHandler_i (void)
- {
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::foo (::CORBA::Long ami_return_val,
- const char * /*answer*/)
- {
- ++this->nr_of_rec_;
- if (ami_return_val == 1)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK foo.\n"));
- --this->nr_of_sent_;
- }
- if (ami_return_val == 2)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: GET ASYNCHRONOUS CALLBACK "
- "FROM SYNCHRONOUS SENT MESSAGE\n"));
- }
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::foo_excep (
- ::CCM_AMI::ExceptionHolder * excep_holder)
- {
- excep_holder->raise_exception ();
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::bar (CORBA::Long l_cmd)
- {
- ++this->nr_of_rec_;
- if (l_cmd == 1)
- {
- --this->nr_of_sent_;
- ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK bar.\n"));
- }
- if (l_cmd == 2)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: GET ASYNCHRONOUS CALLBACK "
- "FROM SYNCHRONOUS SENT MESSAGE\n"));
- }
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::bar_excep (
- ::CCM_AMI::ExceptionHolder * excep_holder)
- {
- excep_holder->raise_exception ();
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::get_rw_attrib (
- ::CORBA::Short /*ami_return_val*/)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK get_rw_attrib.\n"));
- ++this->nr_of_rec_;
- --this->nr_of_sent_;
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::get_rw_attrib_excep (
- ::CCM_AMI::ExceptionHolder * excep_holder)
- {
- excep_holder->raise_exception ();
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::set_rw_attrib (void)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK set_rw_attrib.\n"));
- ++this->nr_of_rec_;
- --this->nr_of_sent_;
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::set_rw_attrib_excep (
- ::CCM_AMI::ExceptionHolder * excep_holder)
- {
- excep_holder->raise_exception ();
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::get_ro_attrib (
- ::CORBA::Short /*ami_return_val*/)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK get_ro_attrib.\n"));
- ++this->nr_of_rec_;
- --this->nr_of_sent_;
- }
-
- void
- AMI4CCM_MyFooReplyHandler_i::get_ro_attrib_excep (
- ::CCM_AMI::ExceptionHolder * excep_holder)
- {
- excep_holder->raise_exception ();
- }
-}
diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h
deleted file mode 100644
index ccc5ff09e5d..00000000000
--- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchTA_conn_i.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// -*- C++ -*-
-// $Id$
-
-/**
- * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3
- * TAO and the TAO IDL Compiler have been developed by:
- * Center for Distributed Object Computing
- * Washington University
- * St. Louis, MO
- * USA
- * http://www.cs.wustl.edu/~schmidt/doc-center.html
- * and
- * Distributed Object Computing Laboratory
- * University of California at Irvine
- * Irvine, CA
- * USA
- * and
- * Institute for Software Integrated Systems
- * Vanderbilt University
- * Nashville, TN
- * USA
- * http://www.isis.vanderbilt.edu/
- *
- * Information about TAO is available at:
- * http://www.cs.wustl.edu/~schmidt/TAO.html
- **/
-
-// TAO_IDL - Generated from
-// be/be_codegen.cpp:1584
-
-#ifndef CIAO_ASYNCHTA_CONN_I_9NTUY9_H_
-#define CIAO_ASYNCHTA_CONN_I_9NTUY9_H_
-
-#include /**/ "ace/pre.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "../Base/AsynchTAC.h"
-
-//original namespace name generated with -Gcn -Gex, replaced with current name
-//namespace CIAO_AsynchT_AMI4CCM_MyFoo_Connector_AMI4CCM_Connector_Impl
-namespace CIAO_AsynchT_Sender_Impl
-{
-
- typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::UShort > Atomic_UShort;
-
- class AMI4CCM_MyFooReplyHandler_i
- : public ::AsynchT::AMI4CCM_MyFooReplyHandler
- {
- public:
- AMI4CCM_MyFooReplyHandler_i (Atomic_UShort &nr_of_sent,
- Atomic_UShort &nr_of_rec);
- virtual ~AMI4CCM_MyFooReplyHandler_i (void);
-
- virtual
- void foo (::CORBA::Long ami_return_val,
- const char * answer);
-
- virtual
- void foo_excep (::CCM_AMI::ExceptionHolder_ptr excep_holder);
-
- virtual
- void bar (::CORBA::Long l_cmd);
-
- virtual
- void bar_excep (::CCM_AMI::ExceptionHolder_ptr excep_holder);
-
- virtual
- void get_rw_attrib (::CORBA::Short rw_attrib);
-
- virtual
- void get_rw_attrib_excep (::CCM_AMI::ExceptionHolder_ptr excep_holder);
-
- virtual
- void set_rw_attrib (void);
-
- virtual
- void set_rw_attrib_excep (::CCM_AMI::ExceptionHolder_ptr excep_holder);
-
- virtual
- void get_ro_attrib (::CORBA::Short ro_attrib);
-
- virtual
- void get_ro_attrib_excep (::CCM_AMI::ExceptionHolder_ptr excep_holder);
- private:
- Atomic_UShort &nr_of_sent_;
- Atomic_UShort &nr_of_rec_;
- };
-}
-
-// TAO_IDL - Generated from
-// be/be_codegen.cpp:2151
-
-
-#include /**/ "ace/post.h"
-
-#endif /* ifndef */
diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc
index a2571bd52ef..b6ec6289a9b 100644
--- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc
+++ b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender.mpc
@@ -92,13 +92,11 @@ project(AMI_AsynchT_Base_Sender_exec) : ciao_executor, ami, ami4ccm_stub {
Source_Files {
AsynchT_Sender_exec.cpp
- AsynchTA_conn_i.cpp
}
Header_Files {
AsynchT_Sender_exec.h
AsynchT_Sender_exec_export.h
- AsynchTA_conn_i.h
}
Inline_Files {
diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp
index c13fb5ce3dc..e5ad85b2169 100644
--- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp
+++ b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.cpp
@@ -26,142 +26,143 @@
**/
#include "AsynchT_Sender_exec.h"
-#include "AsynchTA_conn_i.h"
#include "ace/OS_NS_unistd.h"
namespace CIAO_AsynchT_Sender_Impl
{
- CORBA::Boolean asynch = false;
-
- //============================================================
- // Worker thread for asynchronous invocations for MyFoo
- //============================================================
- asynch_foo_generator::asynch_foo_generator (
- ::AsynchT::CCM_Sender_Context_ptr context,
- Atomic_UShort &nr_of_sent,
- Atomic_UShort &nr_of_rec)
- : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)),
- nr_of_sent_(nr_of_sent),
- nr_of_rec_(nr_of_rec)
- {
- }
-
- int asynch_foo_generator::svc ()
- {
- ::AsynchT::AMI4CCM_MyFoo_var my_foo_ami_ =
- context_->get_connection_sendc_run_my_foo();
-
- ACE_OS::sleep(2);
-
- ::AsynchT::AMI4CCM_MyFooReplyHandler_var cb =
- new CIAO_AsynchT_Sender_Impl::AMI4CCM_MyFooReplyHandler_i (
- this->nr_of_sent_,
- this->nr_of_rec_);
-
- if (CORBA::is_nil (my_foo_ami_))
- {
- ACE_ERROR ((LM_ERROR, "ERROR Sender (ASYNCH) :"
- "\tfoo_ami is NIL !\n"));
- return 1;
- }
- //Invoke Asynchronous calls to test
- ++this->nr_of_sent_;
- my_foo_ami_->sendc_foo ( cb.in(),"Hi ", 1);
- ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL foo.\n"));
-
- ++this->nr_of_sent_;
- my_foo_ami_->sendc_bar ( cb.in(), 1);
- ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL bar.\n"));
-
- ++this->nr_of_sent_;
- my_foo_ami_->sendc_get_rw_attrib( cb.in());
- ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_rw_attrib.\n"));
-
- ++this->nr_of_sent_;
- my_foo_ami_->sendc_set_rw_attrib( cb.in(),2);
- ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL set_rw_attrib.\n"));
-
- ++this->nr_of_sent_;
- ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_ro_attrib.\n"));
- my_foo_ami_->sendc_get_ro_attrib( cb.in());
-
- //there is more than 1 message sent, without receiving callbacks,
- //so it is asynchronous
- if (this->nr_of_sent_.value() > 1)
- {
- asynch = true;
- }
- return 0;
- }
- //============================================================
- // Worker thread for synchronous invocations for MyFoo
- //============================================================
- synch_foo_generator::synch_foo_generator (
- ::AsynchT::CCM_Sender_Context_ptr context)
- : context_(::AsynchT::CCM_Sender_Context::_duplicate (context))
- {
- }
-
- int synch_foo_generator::svc ()
- {
- ::AsynchT::MyFoo_var my_foo_ami_ =
- context_->get_connection_run_my_foo ();
-
- ACE_OS::sleep(1);
- CORBA::Boolean wait = false;
- for (int i = 0; i < 3; ++i)
- {
- // Run some synch calls, answer has to come before the next step.
- CORBA::String_var answer;
- try
- {
- if( wait==true)
- {
- ACE_ERROR ((LM_ERROR,
- "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n"));
- }
- wait = true;
- ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL foo.\n"));
- CORBA::Long result = my_foo_ami_->foo ("Do something synchronous",
- 2 ,
- answer.out ());
- if ( result == 2)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n",
- answer.in ()));
- wait = false;
- }
- if ( wait==true)
- {
- ACE_ERROR ((LM_ERROR,
- "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n"));
- }
- wait = true;
- CORBA::Long l_cmd = 0;
- ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL bar.\n"));
- my_foo_ami_->bar (2,l_cmd);
- if ( l_cmd == 2)
- {
- ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n",
- answer.in ()));
- wait = false;
- }
- }
- catch (const AsynchT::InternalError&)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: synch_foo_generator::foo: "
- "Unexpected exception.\n"));
- }
- }
- return 0;
- }
+
+ CORBA::Boolean asynch = false;
+
+ //============================================================
+ // Worker thread for asynchronous invocations for MyFoo
+ //============================================================
+ asynch_foo_generator::asynch_foo_generator (
+ ::AsynchT::CCM_Sender_Context_ptr context,
+ Atomic_UShort &nr_of_sent,
+ Atomic_UShort &nr_of_rec)
+ : context_(::AsynchT::CCM_Sender_Context::_duplicate (context)),
+ nr_of_sent_(nr_of_sent),
+ nr_of_rec_(nr_of_rec)
+ {
+ }
+
+ int asynch_foo_generator::svc ()
+ {
+ ::AsynchT::AMI4CCM_MyFoo_var my_foo_ami_ =
+ context_->get_connection_sendc_run_my_foo();
+
+ ACE_OS::sleep(2);
+
+ ::AsynchT::AMI4CCM_MyFooReplyHandler_var cb =
+ new CIAO_AsynchT_Sender_Impl::AMI4CCM_MyFooReplyHandler_run_my_foo_i (
+ this->nr_of_sent_,
+ this->nr_of_rec_);
+
+ if (CORBA::is_nil (my_foo_ami_))
+ {
+ ACE_ERROR ((LM_ERROR, "ERROR Sender (ASYNCH) :"
+ "\tfoo_ami is NIL !\n"));
+ return 1;
+ }
+ //Invoke Asynchronous calls to test
+ ++this->nr_of_sent_;
+ my_foo_ami_->sendc_foo ( cb.in(),"Hi ", 1);
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL foo.\n"));
+
+ ++this->nr_of_sent_;
+ my_foo_ami_->sendc_bar ( cb.in(), 1);
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL bar.\n"));
+
+ ++this->nr_of_sent_;
+ my_foo_ami_->sendc_get_rw_attrib( cb.in());
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_rw_attrib.\n"));
+
+ ++this->nr_of_sent_;
+ my_foo_ami_->sendc_set_rw_attrib( cb.in(),2);
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL set_rw_attrib.\n"));
+
+ ++this->nr_of_sent_;
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND ASYNCHRONOUS CALL get_ro_attrib.\n"));
+ my_foo_ami_->sendc_get_ro_attrib( cb.in());
+
+ //there is more than 1 message sent, without receiving callbacks,
+ //so it is asynchronous
+ if (this->nr_of_sent_.value() > 1)
+ {
+ asynch = true;
+ }
+ return 0;
+ }
+ //============================================================
+ // Worker thread for synchronous invocations for MyFoo
+ //============================================================
+ synch_foo_generator::synch_foo_generator (
+ ::AsynchT::CCM_Sender_Context_ptr context)
+ : context_(::AsynchT::CCM_Sender_Context::_duplicate (context))
+ {
+ }
+
+ int synch_foo_generator::svc ()
+ {
+ ::AsynchT::MyFoo_var my_foo_ami_ =
+ context_->get_connection_run_my_foo ();
+
+ ACE_OS::sleep(1);
+ CORBA::Boolean wait = false;
+ for (int i = 0; i < 3; ++i)
+ {
+ // Run some synch calls, answer has to come before the next step.
+ CORBA::String_var answer;
+ try
+ {
+ if( wait==true)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n"));
+ }
+ wait = true;
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL foo.\n"));
+ CORBA::Long result = my_foo_ami_->foo ("Do something synchronous",
+ 2 ,
+ answer.out ());
+ if ( result == 2)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n",
+ answer.in ()));
+ wait = false;
+ }
+ if ( wait==true)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: NOT RECEIVED SYNCHRONOUS answer.\n"));
+ }
+ wait = true;
+ CORBA::Long l_cmd = 0;
+ ACE_DEBUG ((LM_DEBUG, "OK: SEND SYNCHRONOUS CALL bar.\n"));
+ my_foo_ami_->bar (2,l_cmd);
+ if ( l_cmd == 2)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: RECEIVED SYNCHRONOUS answer <%C>\n",
+ answer.in ()));
+ wait = false;
+ }
+ }
+ catch (const AsynchT::InternalError&)
+ {
+ ACE_ERROR ((LM_ERROR, "ERROR: synch_foo_generator::foo: "
+ "Unexpected exception.\n"));
+ }
+ }
+ return 0;
+ }
+
/**
* Component Executor Implementation Class: Sender_exec_i
*/
Sender_exec_i::Sender_exec_i (void)
- : nr_of_sent_ (0),
- nr_of_rec_ (0)
+ : nr_of_sent_ (0),
+ nr_of_rec_ (0)
{
}
@@ -206,7 +207,6 @@ namespace CIAO_AsynchT_Sender_Impl
this->synch_foo_gen =
new synch_foo_generator (this->ciao_context_.in());
this->synch_foo_gen->activate (THR_NEW_LWP | THR_JOINABLE, 1);
-
}
void
@@ -236,6 +236,114 @@ namespace CIAO_AsynchT_Sender_Impl
this->synch_foo_gen = 0;
}
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::AMI4CCM_MyFooReplyHandler_run_my_foo_i (
+ Atomic_UShort &nr_of_sent,
+ Atomic_UShort &nr_of_rec)
+ : nr_of_sent_ (nr_of_sent),
+ nr_of_rec_ (nr_of_rec)
+ {
+ }
+
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::~AMI4CCM_MyFooReplyHandler_run_my_foo_i (void)
+ {
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::foo (
+ ::CORBA::Long ami_return_val,
+ const char * /* answer */)
+ {
+ ++this->nr_of_rec_;
+ if (ami_return_val == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK foo.\n"));
+ --this->nr_of_sent_;
+ }
+ if (ami_return_val == 2)
+ {
+ ACE_ERROR ((LM_ERROR, "ERROR: GET ASYNCHRONOUS CALLBACK "
+ "FROM SYNCHRONOUS SENT MESSAGE\n"));
+ }
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::foo_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder)
+ {
+ excep_holder->raise_exception ();
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::bar (
+ ::CORBA::Long l_cmd)
+ {
+ ++this->nr_of_rec_;
+ if (l_cmd == 1)
+ {
+ --this->nr_of_sent_;
+ ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK bar.\n"));
+ }
+ if (l_cmd == 2)
+ {
+ ACE_ERROR ((LM_ERROR, "ERROR: GET ASYNCHRONOUS CALLBACK "
+ "FROM SYNCHRONOUS SENT MESSAGE\n"));
+ }
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::bar_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder)
+ {
+ excep_holder->raise_exception ();
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::get_rw_attrib (
+ ::CORBA::Short /*rw_attrib*/)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK get_rw_attrib.\n"));
+ ++this->nr_of_rec_;
+ --this->nr_of_sent_;
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::get_rw_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder)
+ {
+ excep_holder->raise_exception ();
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::set_rw_attrib (void)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK set_rw_attrib.\n"));
+ ++this->nr_of_rec_;
+ --this->nr_of_sent_;
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::set_rw_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder)
+ {
+ excep_holder->raise_exception ();
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::get_ro_attrib (
+ ::CORBA::Short /*ro_attrib*/)
+ {
+ ACE_DEBUG ((LM_DEBUG, "OK: GET ASYNCHRONOUS CALLBACK get_ro_attrib.\n"));
+ ++this->nr_of_rec_;
+ --this->nr_of_sent_;
+ }
+
+ void
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i::get_ro_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder)
+ {
+ excep_holder->raise_exception ();
+ }
+
extern "C" ASYNCHT_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
create_AsynchT_Sender_Impl (void)
{
diff --git a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h
index be87046d531..3e6757816f4 100644
--- a/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h
+++ b/CIAO/connectors/ami4ccm/tests/AsynchT/Sender/AsynchT_Sender_exec.h
@@ -24,8 +24,8 @@
* Information about TAO is available at:
* http://www.cs.wustl.edu/~schmidt/TAO.html
**/
-#ifndef CIAO_ASYNCHT_SENDER_EXEC_QWD5YB_H_
-#define CIAO_ASYNCHT_SENDER_EXEC_QWD5YB_H_
+#ifndef CIAO_ASYNCHT_SENDER_EXEC_LZKPQ3_H_
+#define CIAO_ASYNCHT_SENDER_EXEC_LZKPQ3_H_
#include /**/ "ace/pre.h"
#include "ace/Task.h"
@@ -41,39 +41,40 @@
namespace CIAO_AsynchT_Sender_Impl
{
- typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::UShort > Atomic_UShort;
+ typedef ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::UShort> Atomic_UShort;
- /// Worker thread for asynchronous invocations
- class asynch_foo_generator : public virtual ACE_Task_Base
- {
- public:
- asynch_foo_generator (::AsynchT::CCM_Sender_Context_ptr context,
- Atomic_UShort &nr_of_sent,
- Atomic_UShort &nr_of_rec);
+ /// Worker thread for asynchronous invocations
+ class asynch_foo_generator: public virtual ACE_Task_Base
+ {
+ public:
+ asynch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context,
+ Atomic_UShort &nr_of_sent, Atomic_UShort &nr_of_rec);
- virtual int svc (void);
+ virtual int svc(void);
- private:
- ::AsynchT::CCM_Sender_Context_var context_;
- Atomic_UShort &nr_of_sent_;
- Atomic_UShort &nr_of_rec_;
+ private:
+ ::AsynchT::CCM_Sender_Context_var context_;
+ Atomic_UShort &nr_of_sent_;
+ Atomic_UShort &nr_of_rec_;
- };
+ };
- /// Worker thread for synchronous invocations
- class synch_foo_generator : public virtual ACE_Task_Base
- {
- public:
- synch_foo_generator (::AsynchT::CCM_Sender_Context_ptr context);
+ /// Worker thread for synchronous invocations
+ class synch_foo_generator: public virtual ACE_Task_Base
+ {
+ public:
+ synch_foo_generator(::AsynchT::CCM_Sender_Context_ptr context);
- virtual int svc (void);
+ virtual int svc(void);
+
+ private:
+ ::AsynchT::CCM_Sender_Context_var context_;
+ };
- private:
- ::AsynchT::CCM_Sender_Context_var context_;
- };
/**
* Component Executor Implementation Class: Sender_exec_i
*/
+
class Sender_exec_i
: public virtual Sender_Exec,
public virtual ::CORBA::LocalObject
@@ -93,8 +94,7 @@ namespace CIAO_AsynchT_Sender_Impl
//@{
/** Operations from Components::SessionComponent. */
- virtual void
- set_session_context (::Components::SessionContext_ptr ctx);
+ virtual void set_session_context (::Components::SessionContext_ptr ctx);
virtual void configuration_complete (void);
virtual void ccm_activate (void);
virtual void ccm_passivate (void);
@@ -103,6 +103,7 @@ namespace CIAO_AsynchT_Sender_Impl
//@{
/** User defined public operations. */
+
//@}
private:
@@ -110,7 +111,6 @@ namespace CIAO_AsynchT_Sender_Impl
asynch_foo_generator* asynch_foo_gen;
synch_foo_generator* synch_foo_gen;
-
//@{
/** Component attributes. */
//@}
@@ -123,12 +123,66 @@ namespace CIAO_AsynchT_Sender_Impl
//@{
/** User defined private operations. */
+
//@}
};
- extern "C" ASYNCHT_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
- create_AsynchT_Sender_Impl (void);
-}
+ class AMI4CCM_MyFooReplyHandler_run_my_foo_i
+ : public ::AsynchT::CCM_AMI4CCM_MyFooReplyHandler,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ AMI4CCM_MyFooReplyHandler_run_my_foo_i (Atomic_UShort &nr_of_sent,
+ Atomic_UShort &nr_of_rec);
+ virtual ~AMI4CCM_MyFooReplyHandler_run_my_foo_i (void);
+
+ virtual void
+ foo (
+ ::CORBA::Long ami_return_val,
+ const char * answer);
+
+ virtual void
+ foo_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder);
+
+ virtual void
+ bar (
+ ::CORBA::Long l_cmd);
+
+ virtual void
+ bar_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder);
+
+ virtual void
+ get_rw_attrib (
+ ::CORBA::Short rw_attrib);
+
+ virtual void
+ get_rw_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder);
+
+ virtual void
+ set_rw_attrib (void);
+
+ virtual void
+ set_rw_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder);
+
+ virtual void
+ get_ro_attrib (
+ ::CORBA::Short ro_attrib);
+
+ virtual void
+ get_ro_attrib_excep (
+ ::CCM_AMI::ExceptionHolder_ptr excep_holder);
+ private:
+ Atomic_UShort &nr_of_sent_;
+ Atomic_UShort &nr_of_rec_;
+ };
+
+ extern "C" ASYNCHT_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_AsynchT_Sender_Impl (void);
+ }
#include /**/ "ace/post.h"