summaryrefslogtreecommitdiff
path: root/modules/CIAO/connectors/ami4ccm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/CIAO/connectors/ami4ccm')
-rw-r--r--modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-explanation.odtbin0 -> 27491 bytes
-rw-r--r--modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-spec.odtbin0 -> 25152 bytes
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.idl33
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.mpc138
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.cpp239
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.h78
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.cpp168
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.h63
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.cpp365
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.h165
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello.idl30
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.idl39
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.mpc94
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.idl23
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.mpc134
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.cpp248
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.h155
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.idl32
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.mpc134
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.cpp371
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.h214
-rw-r--r--modules/CIAO/connectors/ami4ccm/examples/descriptors/Plan.cdp449
-rwxr-xr-xmodules/CIAO/connectors/ami4ccm/examples/descriptors/run_test.pl206
23 files changed, 3378 insertions, 0 deletions
diff --git a/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-explanation.odt b/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-explanation.odt
new file mode 100644
index 00000000000..3fa615676e7
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-explanation.odt
Binary files differ
diff --git a/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-spec.odt b/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-spec.odt
new file mode 100644
index 00000000000..77964484317
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/docs/AMI4CCM-spec.odt
Binary files differ
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.idl b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.idl
new file mode 100644
index 00000000000..57478b6d997
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.idl
@@ -0,0 +1,33 @@
+// $Id$
+
+#ifndef AMI_IDL
+#define AMI_IDL
+
+#include <Components.idl>
+
+#include "../Hello_Base/Hello_Base.idl"
+
+module Hello_AMI
+{
+ component AMI
+ {
+ //provides the interface for Sender
+ provides CCM_AMI::AMI_MyFoo perform_asynch_my_foo;
+ provides CCM_AMI::AMI_MyInterface perform_asynch_my_interface;
+
+ //uses the interface of the Receiver ('server')
+ uses CCM_AMI::MyFoo my_foo_receiver;
+ uses CCM_AMI::MyInterface my_interface_receiver;
+
+ //uses the callback interface of the sender
+ uses CCM_AMI::AMI_MyFoo_callback callback_my_foo;
+ uses CCM_AMI::AMI_MyInterface_callback callback_my_interface;
+ };
+
+ home AMIHome manages AMI
+ {
+ };
+};
+
+
+#endif
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.mpc b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.mpc
new file mode 100644
index 00000000000..b3f6fe7c6a3
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI.mpc
@@ -0,0 +1,138 @@
+// $Id$
+// This file is generated with "generate_component_mpc.pl -p Hello_Base AMI"
+
+project(Hello_Base_AMI_idl_gen) : componentidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=AMI_STUB_Export \
+ -Wb,stub_export_include=AMI_stub_export.h \
+ -Wb,skel_export_macro=AMI_SVNT_Export \
+ -Wb,skel_export_include=AMI_svnt_export.h \
+ -Wb,exec_export_macro=AMI_EXEC_Export \
+ -Wb,exec_export_include=AMI_exec_export.h
+
+ IDL_Files {
+ AMI.idl
+ }
+}
+
+project(Hello_Base_AMI_lem_gen) : ciaoidldefaults {
+ after += Hello_Base_AMI_idl_gen
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=AMI_LEM_STUB_Export \
+ -Wb,stub_export_include=AMI_lem_stub_export.h \
+ -SS -Gxhst
+
+ IDL_Files {
+ AMIE.idl
+ }
+}
+
+project(Hello_Base_AMI_lem_stub) : ccm_svnt, ami {
+ after += Hello_Base_AMI_lem_gen Hello_Base_AMI_stub Hello_Base_stub
+ libs += Hello_Base_stub AMI_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = AMI_lem_stub
+ dynamicflags = AMI_LEM_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AMIEC.cpp
+ }
+
+ Header_Files {
+ AMIEC.h
+ AMI_lem_stub_export.h
+ }
+
+ Inline_Files {
+ AMIEC.inl
+ }
+}
+
+project(Hello_Base_AMI_stub) : ccm_stub, ami {
+ after += Hello_Base_AMI_idl_gen Hello_Base_stub
+ libs += Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = AMI_stub
+ dynamicflags = AMI_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AMIC.cpp
+ }
+
+ Header_Files {
+ AMIC.h
+ AMI_stub_export.h
+ }
+
+ Inline_Files {
+ AMIC.inl
+ }
+}
+
+project(Hello_Base_AMI_exec) : ciao_executor, ami {
+ after += Hello_Base_AMI_lem_stub Hello_Base_AMI_stub
+ sharedname = AMI_exec
+ libs += AMI_stub AMI_lem_stub Hello_Base_stub Hello_Base_skel
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = AMI_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AMI_exec.cpp
+ AMI_MyFoo_i.cpp
+ AMI_MyInterface_i.cpp
+ }
+
+ Header_Files {
+ AMI_exec.h
+ AMI_MyFoo_i.h
+ AMI_MyInterface_i.h
+ AMI_exec_export.h
+ }
+
+ Inline_Files {
+ }
+}
+
+
+project(Hello_Base_AMI_svnt) : ciao_servant, ami {
+ after += Hello_Base_skel Hello_Base_AMI_lem_stub
+ sharedname = AMI_svnt
+ libs += AMI_stub AMI_lem_stub \
+ Hello_Base_skel \
+ Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = AMI_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AMIS.cpp
+ AMI_svnt.cpp
+ }
+
+ Header_Files {
+ AMIS.h
+ AMI_svnt.h
+ AMI_svnt_export.h
+ }
+
+ Inline_Files {
+ AMIS.inl
+ }
+}
+
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.cpp b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.cpp
new file mode 100644
index 00000000000..5bab675fbfd
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.cpp
@@ -0,0 +1,239 @@
+// $Id$
+
+#include "AMI_MyFoo_i.h"
+
+namespace CCM_CORBA_AMI_MyFoo_Impl
+{
+ //============================================================
+ // Implementation of the AMI CORBA FOO reply handler
+ //============================================================
+ AMI_MyFoo_reply_handler::AMI_MyFoo_reply_handler (::CCM_AMI::AMI_MyFoo_callback_ptr foo_callback)
+ : foo_callback_ (::CCM_AMI::AMI_MyFoo_callback::_duplicate (foo_callback))
+ {
+ }
+
+ AMI_MyFoo_reply_handler::~AMI_MyFoo_reply_handler ()
+ {
+ }
+
+ // FOO methods
+ void
+ AMI_MyFoo_reply_handler::foo (
+ CORBA::Long result,
+ const char * out_str)
+ {
+ printf ("AMI CORBA (FOO) :\tMyFoo Foo Reply Handler::foo\n");
+ foo_callback_->foo_callback_handler (result, CORBA::string_dup (out_str));
+ this->_remove_ref ();
+ }
+
+ void
+ AMI_MyFoo_reply_handler::foo_excep (
+ ::Messaging::ExceptionHolder * excep_holder)
+ {
+ printf ("AMI CORBA (FOO) :\tMyFoo Foo Reply Handler::foo_excep\n");
+
+ try
+ {
+ excep_holder->raise_exception ();
+ }
+ catch (const CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (FOO) :\tCaught the correct exception type (CCM_AMI::InternalError) <%d> <%s>\n",
+ ex.ex.id, ex.ex.error_string.in ());
+
+ foo_callback_->foo_callback_excep (ex.ex);
+
+ if (ex.ex.id != 42)
+ {
+ printf ("ERROR (FOO):\tReceived unexpected ID received in exception handler\n");
+ }
+ if (ACE_OS::strcmp (ex.ex.error_string.in (), "Hello world") != 0)
+ {
+ printf ("ERROR (FOO):\tReceived unexpected error string received in exception handler\n");
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("ERROR (FOO) :\tCaught the WRONG exception:");
+ }
+ this->_remove_ref ();
+ }
+
+ // HELLO methods
+ void
+ AMI_MyFoo_reply_handler::hello (
+ CORBA::Long answer)
+ {
+ printf ("AMI CORBA (FOO) :\tMyFoo Hello Reply Handler::foo\n");
+ foo_callback_->hello_callback_handler (answer);
+ this->_remove_ref ();
+ }
+
+ void
+ AMI_MyFoo_reply_handler::hello_excep (
+ ::Messaging::ExceptionHolder * excep_holder)
+ {
+ printf ("AMI CORBA (FOO) :\tMyFoo Hello Reply Handler::foo_excep\n");
+
+ try
+ {
+ excep_holder->raise_exception ();
+ }
+ catch (const CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (FOO) :\tCaught the correct exception type (CCM_AMI::InternalError) <%d> <%s>\n",
+ ex.ex.id, ex.ex.error_string.in ());
+
+ foo_callback_->hello_callback_excep (ex.ex);
+
+ if (ex.ex.id != 42)
+ {
+ printf ("ERROR (FOO):\tReceived unexpected ID received in exception handler\n");
+ }
+ if (ACE_OS::strcmp (ex.ex.error_string.in (), "Hello world") != 0)
+ {
+ printf ("ERROR (FOO):\tReceived unexpected error string received in exception handler\n");
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("ERROR (FOO) :\tCaught the WRONG exception:");
+ }
+ this->_remove_ref ();
+ }
+
+ //============================================================
+ // Implementation of the AMI CORBA FOO interface
+ //============================================================
+ AMI_MyFoo_i::AMI_MyFoo_i (CORBA::ORB_ptr orb, ::CCM_AMI::MyFoo_ptr foo_receiver)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ foo_receiver_ (::CCM_AMI::MyFoo::_duplicate (foo_receiver))
+ {
+ }
+
+ CORBA::Long
+ AMI_MyFoo_i::foo (const char * in_str,
+ CORBA::String_out out_str)
+ {
+ try
+ {
+ printf ("AMI CORBA (FOO) :\tReceived string <%s>. Try passing it to the Receiver component\n", in_str);
+ CORBA::Long result = foo_receiver_->foo (CORBA::string_dup (in_str), out_str);
+ return result;
+ }
+ catch (CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (FOO) :\tCORRECT EXCEPTION -> re-throwing\n");
+ CCM_AMI::InternalException excep;
+ excep.id = ex.ex.id;
+ excep.error_string = CORBA::string_dup (ex.ex.error_string);
+ throw CCM_AMI::InternalError (excep);
+ }
+ catch (...)
+ {
+ printf ("AMI CORBA (FOO) :\t!!!!!UNKNOWN EXCEPTION!!!!!\n");
+ CCM_AMI::InternalException excep;
+ excep.id = 43;
+ excep.error_string = CORBA::string_dup ("UNKNOWN");
+ throw CCM_AMI::InternalError (excep);
+ }
+ }
+
+ void
+ AMI_MyFoo_i::hello (CORBA::Long_out answer)
+ {
+ try
+ {
+ printf ("AMI CORBA (FOO) :\tHello. Try calling the Receiver component\n");
+ foo_receiver_->hello (answer);
+ }
+ catch (CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (FOO) :\tCORRECT EXCEPTION -> re-throwing\n");
+ CCM_AMI::InternalException excep;
+ excep.id = ex.ex.id;
+ excep.error_string = CORBA::string_dup (ex.ex.error_string);
+ throw CCM_AMI::InternalError (excep);
+ }
+ catch (...)
+ {
+ printf ("AMI CORBA (FOO) :\t!!!!!UNKNOWN EXCEPTION!!!!!\n");
+ CCM_AMI::InternalException excep;
+ excep.id = 43;
+ excep.error_string = CORBA::string_dup ("UNKNOWN");
+ throw CCM_AMI::InternalError (excep);
+ }
+ }
+
+ //============================================================
+ // Worker thread to service the AMI CORBA FOO interface
+ //============================================================
+ CORBA_MyFoo_server::CORBA_MyFoo_server (::CCM_AMI::MyFoo_ptr foo_receiver)
+ : foo_receiver_ (::CCM_AMI::MyFoo::_duplicate (foo_receiver))
+ {
+ }
+
+ int CORBA_MyFoo_server::svc ()
+ {
+ try
+ {
+ int argc = 2;
+ ACE_TCHAR **argv = new ACE_TCHAR *[argc];
+ argv[0] = ACE::strnew (ACE_TEXT (""));
+ argv[1] = ACE::strnew (ACE_TEXT (""));
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ACE_TEXT ("CORBA_MyFoo_server"));
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ printf ("Server :\tERROR creating POA \n");
+ return 1;
+ }
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ AMI_MyFoo_i AMI_MyFoo_i (orb.in (), foo_receiver_);
+
+ PortableServer::ObjectId_var id =
+ root_poa->activate_object (&AMI_MyFoo_i);
+
+ CORBA::Object_var object = root_poa->id_to_reference (id.in ());
+
+ CCM_AMI::MyFoo_var ami_foo_var =
+ CCM_AMI::MyFoo::_narrow (object.in ());
+
+ CORBA::String_var ior =
+ orb->object_to_string (ami_foo_var.in ());
+
+ // If the ior_output_file exists, output the ior to it
+ FILE *output_file= ACE_OS::fopen ("foo.ior", "w");
+ if (output_file == 0)
+ {
+ printf ("Cannot open output file for writing IOR: server.ior\n");
+ return 1;
+ }
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate ();
+
+ printf ("AMI CORBA (FOO) :\tFOO Server is activated\n");
+
+ orb->run ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Caught exception:");
+ return 1;
+ }
+
+ return 0;
+ }
+}
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.h b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.h
new file mode 100644
index 00000000000..377e8b02bbc
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyFoo_i.h
@@ -0,0 +1,78 @@
+// $Id$
+
+#ifndef AMI_MyFoo_i_H
+#define AMI_MyFoo_i_H
+
+#include "AMIS.h"
+#include "ace/Task.h"
+
+namespace CCM_CORBA_AMI_MyFoo_Impl
+{
+ //============================================================
+ // Implementation of the AMI CORBA FOO reply handler
+ //============================================================
+ class AMI_MyFoo_reply_handler : public POA_CCM_AMI::AMI_MyFooHandler
+ {
+ public:
+ AMI_MyFoo_reply_handler (
+ ::CCM_AMI::AMI_MyFoo_callback_ptr foo_callback);
+ ~AMI_MyFoo_reply_handler (void);
+
+ void
+ foo (
+ CORBA::Long result,
+ const char * out_str);
+
+ void
+ foo_excep (
+ ::Messaging::ExceptionHolder * excep_holder);
+
+ void
+ hello (
+ CORBA::Long answer);
+
+ void
+ hello_excep (
+ ::Messaging::ExceptionHolder * excep_holder);
+
+ private:
+ ::CCM_AMI::AMI_MyFoo_callback_var foo_callback_;
+ };
+
+ class AMI_MyFoo_i : public POA_CCM_AMI::MyFoo
+ {
+ public:
+ /// ctor
+ AMI_MyFoo_i (
+ CORBA::ORB_ptr orb,
+ ::CCM_AMI::MyFoo_ptr foo_receiver);
+
+ // The AMI methods.
+ CORBA::Long
+ foo (
+ const char * in_str,
+ CORBA::String_out out_str);
+
+ void
+ hello (
+ CORBA::Long_out answer);
+
+ private:
+ CORBA::ORB_var orb_;
+ ::CCM_AMI::MyFoo_var foo_receiver_;
+ };
+
+ // CORBA server which delivers the MyFoo interface
+ class CORBA_MyFoo_server : public ACE_Task_Base
+ {
+ public:
+ CORBA_MyFoo_server (
+ ::CCM_AMI::MyFoo_ptr foo_receiver);
+ virtual int svc (void);
+
+ private:
+ ::CCM_AMI::MyFoo_var foo_receiver_;
+ };
+};
+#endif /* AMI_MyFoo_i_H */
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.cpp b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.cpp
new file mode 100644
index 00000000000..b4cf296368f
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.cpp
@@ -0,0 +1,168 @@
+// $Id$
+
+#include "AMI_MyInterface_i.h"
+
+namespace CCM_CORBA_AMI_MyInterface_Impl
+{
+ //============================================================
+ // Implementation of the AMI CORBA INTERFACE reply handler
+ //============================================================
+ AMI_MyInterface_reply_handler::AMI_MyInterface_reply_handler (
+ ::CCM_AMI::AMI_MyInterface_callback_ptr interface_callback)
+ : interface_callback_ (::CCM_AMI::AMI_MyInterface_callback::_duplicate (interface_callback))
+ {
+ }
+
+ AMI_MyInterface_reply_handler::~AMI_MyInterface_reply_handler ()
+ {
+ }
+
+ void
+ AMI_MyInterface_reply_handler::do_something_with_something (
+ CORBA::Float result)
+ {
+ printf ("AMI CORBA :\tMyInterface Reply Handler::do_something_with_something\n");
+ interface_callback_->do_something_with_something_callback_handler (result);
+ this->_remove_ref ();
+ }
+
+ void
+ AMI_MyInterface_reply_handler::do_something_with_something_excep (
+ ::Messaging::ExceptionHolder * excep_holder)
+ {
+ printf ("AMI CORBA :\tMyInterface Reply Handler::do_something_with_something_excep\n");
+
+ try
+ {
+ excep_holder->raise_exception ();
+ }
+ catch (const CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (INTERFACE) :\tCaught the correct exception type (CCM_AMI::InternalError) <%d> <%s>\n",
+ ex.ex.id, ex.ex.error_string.in ());
+
+ interface_callback_->do_something_with_something_callback_excep (ex.ex);
+
+ if (ex.ex.id != 42)
+ {
+ printf ("ERROR (INTERFACE) :\tReceived unexpected ID received in exception handler\n");
+ }
+ if (ACE_OS::strcmp (ex.ex.error_string.in (), "Hello world") != 0)
+ {
+ printf ("ERROR (INTERFACE) :\tReceived unexpected error string received in exception handler\n");
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("ERROR (FOO) :\tCaught the WRONG exception:");
+ }
+ this->_remove_ref ();
+ }
+
+ //============================================================
+ // Implementation of the AMI CORBA FOO interface
+ //============================================================
+ AMI_MyInterface_i::AMI_MyInterface_i (CORBA::ORB_ptr orb, ::CCM_AMI::MyInterface_ptr interface_receiver)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ interface_receiver_ (::CCM_AMI::MyInterface::_duplicate (interface_receiver))
+ {
+ }
+
+ CORBA::Float
+ AMI_MyInterface_i::do_something_with_something (CORBA::Short something)
+ {
+ try
+ {
+ printf ("AMI CORBA (INTERFACE) :\tReceived short <%d>. Try passing it to the Receiver component\n", something);
+ CORBA::Float result = interface_receiver_->do_something_with_something (something);
+ return result;
+ }
+ catch (CCM_AMI::InternalError& ex)
+ {
+ printf ("AMI CORBA (INTERFACE) :\tCORRECT EXCEPTION -> re-throwing\n");
+ CCM_AMI::InternalException excep;
+ excep.id = ex.ex.id;
+ excep.error_string = CORBA::string_dup (ex.ex.error_string);
+ throw CCM_AMI::InternalError (excep);
+ }
+ catch (...)
+ {
+ printf ("AMI CORBA (INTERFACE) :\t!!!!!UNKNOWN EXCEPTION!!!!!\n");
+ CCM_AMI::InternalException excep;
+ excep.id = 43;
+ excep.error_string = CORBA::string_dup ("UNKNOWN");
+ throw CCM_AMI::InternalError (excep);
+ }
+ }
+
+ //============================================================
+ // Worker thread to service the AMI CORBA FOO interface
+ //============================================================
+ CORBA_MyInterface_server::CORBA_MyInterface_server (::CCM_AMI::MyInterface_ptr interface_receiver)
+ : interface_receiver_ (::CCM_AMI::MyInterface::_duplicate (interface_receiver))
+ {
+ }
+
+ int CORBA_MyInterface_server::svc ()
+ {
+ try
+ {
+ int argc = 2;
+ ACE_TCHAR **argv = new ACE_TCHAR *[argc];
+ argv[0] = ACE::strnew (ACE_TEXT (""));
+ argv[1] = ACE::strnew (ACE_TEXT (""));
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ACE_TEXT ("CORBA_MyInterface_server"));
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ printf ("Server :\tERROR creating POA \n");
+ return 1;
+ }
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ AMI_MyInterface_i AMI_MyInterface_i (orb.in (), interface_receiver_);
+
+ PortableServer::ObjectId_var id =
+ root_poa->activate_object (&AMI_MyInterface_i);
+
+ CORBA::Object_var object = root_poa->id_to_reference (id.in ());
+
+ CCM_AMI::MyInterface_var ami_interface_var =
+ CCM_AMI::MyInterface::_narrow (object.in ());
+
+ CORBA::String_var ior =
+ orb->object_to_string (ami_interface_var.in ());
+
+ // If the ior_output_file exists, output the ior to it
+ FILE *output_file= ACE_OS::fopen ("interface.ior", "w");
+ if (output_file == 0)
+ {
+ printf ("Cannot open output file for writing IOR: interface.ior\n");
+ return 1;
+ }
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate ();
+
+ printf ("AMI CORBA (INTERFACE) :\tServer is activated\n");
+
+ orb->run ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Caught exception:");
+ return 1;
+ }
+
+ return 0;
+ }
+}
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.h b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.h
new file mode 100644
index 00000000000..3eb2b2d04f8
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_MyInterface_i.h
@@ -0,0 +1,63 @@
+// $Id$
+
+#ifndef AMI_MyInterface_i_H
+#define AMI_MyInterface_i_H
+
+#include "AMIS.h"
+#include "ace/Task.h"
+
+namespace CCM_CORBA_AMI_MyInterface_Impl
+{
+ //============================================================
+ // Implementation of the AMI CORBA INTERFACE reply handler
+ //============================================================
+ class AMI_MyInterface_reply_handler : public POA_CCM_AMI::AMI_MyInterfaceHandler
+ {
+ public:
+ AMI_MyInterface_reply_handler (
+ ::CCM_AMI::AMI_MyInterface_callback_ptr interface_callback);
+ ~AMI_MyInterface_reply_handler (void);
+
+ void
+ do_something_with_something (
+ CORBA::Float result);
+
+ void
+ do_something_with_something_excep (
+ ::Messaging::ExceptionHolder * excep_holder);
+
+ private:
+ ::CCM_AMI::AMI_MyInterface_callback_var interface_callback_;
+ };
+
+ class AMI_MyInterface_i : public POA_CCM_AMI::MyInterface
+ {
+ public:
+ /// ctor
+ AMI_MyInterface_i (
+ CORBA::ORB_ptr orb,
+ ::CCM_AMI::MyInterface_ptr interface_receiver);
+
+ CORBA::Float
+ do_something_with_something (
+ CORBA::Short something);
+
+ private:
+ CORBA::ORB_var orb_;
+ ::CCM_AMI::MyInterface_var interface_receiver_;
+ };
+
+ // CORBA server which delivers the MyInterface interface
+ class CORBA_MyInterface_server : public ACE_Task_Base
+ {
+ public:
+ CORBA_MyInterface_server (
+ ::CCM_AMI::MyInterface_ptr interface_receiver);
+ virtual int svc (void);
+
+ private:
+ ::CCM_AMI::MyInterface_var interface_receiver_;
+ };
+};
+#endif /* AMI_MyInterface_i_H */
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.cpp b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.cpp
new file mode 100644
index 00000000000..f84da8ceeb3
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.cpp
@@ -0,0 +1,365 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt Universityaaa
+// 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:1278
+
+#include "AMI_exec.h"
+#include "ciao/CIAO_common.h"
+#include "AMI_MyFoo_i.h"
+#include "AMI_MyInterface_i.h"
+#include "ace/OS_NS_unistd.h"
+
+namespace CIAO_Hello_AMI_AMI_Impl
+{
+ //============================================================
+ // Worker thread to call "perform_work"
+ //============================================================
+ AMI_perform_work::AMI_perform_work (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ {
+ }
+
+ int AMI_perform_work::svc ()
+ {
+ try
+ {
+ printf ("AMI :\tPerform work started\n");
+ while (1)
+ {
+ if (orb_->work_pending())
+ orb_->perform_work();
+ ACE_Time_Value tv (0, 1000);
+ ACE_OS::sleep (tv);
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Caught exception:");
+ return 1;
+ }
+ printf ("AMI :\t Exiting perform work");
+ return 0;
+ }
+
+
+ //============================================================
+ // Facet Executor Implementation Class: AMI_MyFoo_exec_i
+ //============================================================
+ AMI_MyFoo_exec_i::AMI_MyFoo_exec_i (
+ ::CCM_AMI::AMI_MyFoo_callback_ptr foo_callback)
+ : foo_callback_ (::CCM_AMI::AMI_MyFoo_callback::_duplicate (foo_callback))
+ {
+ //initialize AMI client
+ int argc = 2;
+ ACE_TCHAR **argv = new ACE_TCHAR *[argc];
+ argv[0] = ACE::strnew (ACE_TEXT ("-ORBAMICollocation"));
+ argv[1] = ACE::strnew (ACE_TEXT ("0"));
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ACE_TEXT ("AMI_foo_client"));
+
+ CORBA::Object_var object =
+ orb->string_to_object ("file://foo.ior");
+ ami_foo_server_ = CCM_AMI::MyFoo::_narrow (object.in ());
+
+ if (CORBA::is_nil (ami_foo_server_.in ()))
+ {
+ printf ("Server is NIL\n");
+ }
+ // Activate POA to handle the call back.
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ printf ("POA is NIL!\n");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ poa_manager->activate ();
+ AMI_perform_work *pw = new AMI_perform_work (orb.in ());
+ pw->activate ();
+ }
+
+ AMI_MyFoo_exec_i::~AMI_MyFoo_exec_i (void)
+ {
+ }
+
+ // Operations from ::CCM_AMI::AMI_ami_foo
+
+ void
+ AMI_MyFoo_exec_i::sendc_foo (
+ const char * in_str)
+ {
+ printf ("AMI (FOO) :\tsendc_foo <%s>\n", in_str);
+
+ ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler =
+ new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_);
+ CCM_AMI::AMI_MyFooHandler_var the_handler_var = handler->_this ();
+ printf ("AMI (FOO) :\tSending string <%s> to AMI CORBA server\n", in_str);
+ ami_foo_server_->sendc_foo (the_handler_var.in (), in_str);
+ printf ("AMI (FOO) : \tInvoked sendc_foo\n");
+ }
+
+ void
+ AMI_MyFoo_exec_i::sendc_hello ()
+ {
+ printf ("AMI (FOO) :\tsendc_hello\n");
+
+ ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler =
+ new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_);
+ CCM_AMI::AMI_MyFooHandler_var the_handler_var = handler->_this ();
+ printf ("AMI (FOO) :\tCalling AMI CORBA server\n");
+ ami_foo_server_->sendc_hello (the_handler_var.in ());
+ printf ("AMI (FOO) : \tInvoked sendc_foo\n");
+ }
+
+ //============================================================
+ // Facet Executor Implementation Class: AMI_MyFoo_exec_i
+ //============================================================
+
+ AMI_MyInterface_exec_i::AMI_MyInterface_exec_i (
+ ::CCM_AMI::AMI_MyInterface_callback_ptr interface_callback)
+ : interface_callback_ (::CCM_AMI::AMI_MyInterface_callback::_duplicate (interface_callback))
+ {
+ //initialize AMI client
+ int argc = 2;
+ ACE_TCHAR **argv = new ACE_TCHAR *[argc];
+ argv[0] = ACE::strnew (ACE_TEXT ("-ORBAMICollocation"));
+ argv[1] = ACE::strnew (ACE_TEXT ("0"));
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ACE_TEXT ("AMI_Interface_client"));
+
+ CORBA::Object_var object =
+ orb->string_to_object ("file://interface.ior");
+ ami_interface_server_ = CCM_AMI::MyInterface::_narrow (object.in ());
+
+ if (CORBA::is_nil (ami_interface_server_.in ()))
+ {
+ printf ("Server is NIL\n");
+ }
+ // Activate POA to handle the call back.
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ printf ("POA is NIL!\n");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ poa_manager->activate ();
+ AMI_perform_work *pw = new AMI_perform_work (orb.in ());
+ pw->activate ();
+ }
+
+ AMI_MyInterface_exec_i::~AMI_MyInterface_exec_i (void)
+ {
+ }
+
+ // Operations from ::CCM_AMI::AMI_ami_foo
+
+ void
+ AMI_MyInterface_exec_i::sendc_do_something_with_something (
+ ::CCM_AMI::AMI_MyInterface_callback_ptr cb_handler,
+ CORBA::Short something)
+ {
+ printf ("AMI (INTERFACE) :\tsendc_do_something_with_something <%d>\n", something);
+ if (CORBA::is_nil (cb_handler))
+ { //treat it as an oneway CORBA invocation
+ printf ("AMI (INTERFACE) :\tONE WAY INVOCATION. Sending short <%d> to AMI CORBA server\n", something);
+ ami_interface_server_->sendc_do_something_with_something (0, something);
+ printf ("AMI (INTERFACE) : \tInvoked sendc_do_something_with_something\n");
+ }
+ else
+ {
+ ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler* handler =
+ new ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler (cb_handler);
+ CCM_AMI::AMI_MyInterfaceHandler_var the_handler_var = handler->_this ();
+ printf ("AMI (INTERFACE) :\tSending short <%d> to AMI CORBA server\n", something);
+ ami_interface_server_->sendc_do_something_with_something (the_handler_var.in (), something);
+ printf ("AMI (INTERFACE) : \tInvoked sendc_do_something_with_something\n");
+ }
+ }
+
+ //============================================================
+ // Component Executor Implementation Class: AMI_exec_i
+ //============================================================
+
+ AMI_exec_i::AMI_exec_i (void)
+ {
+ }
+
+ AMI_exec_i::~AMI_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ ::CCM_AMI::CCM_AMI_MyFoo_ptr
+ AMI_exec_i::get_perform_asynch_my_foo (void)
+ {
+ ::CCM_AMI::AMI_MyFoo_callback_var foo_callback =
+ this->context_->get_connection_callback_my_foo ();
+ return new AMI_MyFoo_exec_i (foo_callback.in ());
+ }
+
+ ::CCM_AMI::CCM_AMI_MyInterface_ptr
+ AMI_exec_i::get_perform_asynch_my_interface ()
+ {
+ ::CCM_AMI::AMI_MyInterface_callback_var interface_callback =
+ this->context_->get_connection_callback_my_interface ();
+ return new AMI_MyInterface_exec_i (interface_callback.in ());
+ }
+
+ // Operations from Components::SessionComponent.
+
+ void
+ AMI_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ ::Hello_AMI::CCM_AMI_Context::_narrow (ctx);
+
+ if ( ::CORBA::is_nil (this->context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ AMI_exec_i::configuration_complete (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ AMI_exec_i::ccm_activate (void)
+ {
+ ::CCM_AMI::MyFoo_var receiver_foo =
+ this->context_->get_connection_my_foo_receiver ();
+ ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server* foo_srv =
+ new ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server (receiver_foo.in ());
+ printf ("AMI :\tStarting MyFoo CORBA server thread.\n");
+ foo_srv->activate ();
+
+ ::CCM_AMI::MyInterface_var receiver_interface =
+ this->context_->get_connection_my_interface_receiver ();
+ ::CCM_CORBA_AMI_MyInterface_Impl::CORBA_MyInterface_server* interface_srv =
+ new ::CCM_CORBA_AMI_MyInterface_Impl::CORBA_MyInterface_server (receiver_interface.in ());
+ printf ("AMI :\tStarting MyInterface CORBA server thread.\n");
+ interface_srv->activate ();
+ }
+
+ void
+ AMI_exec_i::ccm_passivate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ AMI_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_AMI_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ AMI_exec_i,
+ ::Components::EnterpriseComponent::_nil ());
+
+ return retval;
+ }
+}
+
+namespace CIAO_Hello_AMI_AMI_Impl
+{
+ //============================================================
+ // Home Executor Implementation Class: AMIHome_exec_i
+ //============================================================
+
+ AMIHome_exec_i::AMIHome_exec_i (void)
+ {
+ }
+
+ AMIHome_exec_i::~AMIHome_exec_i (void)
+ {
+ }
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ ::Components::EnterpriseComponent_ptr
+ AMIHome_exec_i::create (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_THROW_EX (
+ retval,
+ AMI_exec_i,
+ ::CORBA::NO_MEMORY ());
+
+ return retval;
+ }
+
+ extern "C" ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_AMIHome_Impl (void)
+ {
+ ::Components::HomeExecutorBase_ptr retval =
+ ::Components::HomeExecutorBase::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ AMIHome_exec_i,
+ ::Components::HomeExecutorBase::_nil ());
+
+ return retval;
+ }
+}
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.h b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.h
new file mode 100644
index 00000000000..716a2d033ad
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/AMI/AMI_exec.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// 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:1217
+
+#ifndef CIAO_AMI_EXEC_H_
+#define CIAO_AMI_EXEC_H_
+
+
+#include "AMIEC.h"
+#include "AMI_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "ace/Task.h"
+
+namespace CIAO_Hello_AMI_AMI_Impl
+{
+ class AMI_perform_work : public ACE_Task_Base
+ {
+ public:
+ AMI_perform_work (CORBA::ORB_ptr orb);
+ virtual int svc (void);
+
+ private:
+ CORBA::ORB_var orb_;
+ };
+
+ class AMI_MyFoo_exec_i
+ : public virtual ::CCM_AMI::CCM_AMI_MyFoo,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ AMI_MyFoo_exec_i (::CCM_AMI::AMI_MyFoo_callback_ptr foo_callback);
+
+ virtual ~AMI_MyFoo_exec_i (void);
+ virtual void
+ sendc_foo (
+ const char * in_str);
+
+ virtual void
+ sendc_hello ();
+
+ private:
+ CCM_AMI::MyFoo_var ami_foo_server_;
+ ::CCM_AMI::AMI_MyFoo_callback_var foo_callback_;
+ };
+
+ class AMI_MyInterface_exec_i
+ : public virtual ::CCM_AMI::CCM_AMI_MyInterface,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ AMI_MyInterface_exec_i (::CCM_AMI::AMI_MyInterface_callback_ptr foo_callback);
+
+ virtual ~AMI_MyInterface_exec_i (void);
+
+ virtual void
+ sendc_do_something_with_something (
+ ::CCM_AMI::AMI_MyInterface_callback_ptr cb_handler,
+ CORBA::Short something);
+
+ private:
+ CCM_AMI::MyInterface_var ami_interface_server_;
+ ::CCM_AMI::AMI_MyInterface_callback_var interface_callback_;
+ };
+
+ class AMI_exec_i
+ : public virtual AMI_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ AMI_exec_i (void);
+ virtual ~AMI_exec_i (void);
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ virtual ::CCM_AMI::CCM_AMI_MyFoo_ptr
+ get_perform_asynch_my_foo (void);
+
+ virtual ::CCM_AMI::CCM_AMI_MyInterface_ptr
+ get_perform_asynch_my_interface (void);
+
+ // Operations from Components::SessionComponent.
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void configuration_complete (void);
+
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+
+ private:
+ ::Hello_AMI::CCM_AMI_Context_var context_;
+ ::CCM_AMI::AMI_MyFoo_callback_var callback_foo_;
+ };
+
+ extern "C" AMI_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_AMI_Impl (void);
+}
+
+namespace CIAO_Hello_AMI_AMI_Impl
+{
+ class AMIHome_exec_i
+ : public virtual AMIHome_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ AMIHome_exec_i (void);
+
+ virtual ~AMIHome_exec_i (void);
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ virtual ::Components::EnterpriseComponent_ptr
+ create (void);
+ };
+
+ extern "C" AMI_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_AMIHome_Impl (void);
+}
+
+#endif /* ifndef */
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello.idl b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello.idl
new file mode 100644
index 00000000000..9b71378fbae
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello.idl
@@ -0,0 +1,30 @@
+// $Id$
+
+module CCM_AMI
+{
+ struct InternalException
+ {
+ long id;
+ string error_string;
+ };
+
+ exception InternalError
+ {
+ InternalException ex;
+ };
+
+ // Sender/Receiver interface
+ interface MyFoo
+ {
+ long foo (in string in_str, out string answer)
+ raises (InternalError);
+ void hello (out long answer)
+ raises (InternalError);
+ };
+
+ interface MyInterface
+ {
+ float do_something_with_something (in short something)
+ raises (InternalError);
+ };
+};
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.idl b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.idl
new file mode 100644
index 00000000000..e90daec3a18
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.idl
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "Hello.idl"
+
+module CCM_AMI
+{
+
+ // callback interface from AMI-component to Sender component
+ interface AMI_MyFoo_callback
+ {
+ void foo_callback_handler (in long result, in string answer);
+ void foo_callback_excep (in CCM_AMI::InternalException exception_holder);
+
+ void hello_callback_handler (in long answer);
+ void hello_callback_excep (in CCM_AMI::InternalException exception_holder);
+ };
+
+ // AMI component. Sender calls AMI-component and AMI-component calls Receiver
+ // using the AMI_foo interface.
+ // Example of a global reply handler
+ interface AMI_MyFoo
+ {
+ void sendc_foo (in string in_str);
+ void sendc_hello ();
+ };
+
+ // callback interface from AMI-component to Sender component
+ // Example of a reply handler per request.
+ interface AMI_MyInterface_callback
+ {
+ void do_something_with_something_callback_handler (in float result);
+ void do_something_with_something_callback_excep (in CCM_AMI::InternalException exception_holder);
+ };
+
+ interface AMI_MyInterface
+ {
+ void sendc_do_something_with_something (in AMI_MyInterface_callback cb_handler, in short something);
+ };
+};
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.mpc b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.mpc
new file mode 100644
index 00000000000..12dfd08220a
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Hello_Base/Hello_Base.mpc
@@ -0,0 +1,94 @@
+// $Id$
+// This file is generated with "generate_component_mpc.pl -n Hello_Base"
+
+project(Hello_idl_gen) : componentidldefaults, ami {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_STUB_Export \
+ -Wb,stub_export_include=Hello_stub_export.h \
+ -Wb,skel_export_macro=HELLO_SKEL_Export \
+ -Wb,skel_export_include=Hello_skel_export.h \
+ -Wb,exec_export_macro=HELLO_EXEC_Export \
+ -Wb,exec_export_include=Hello_exec_export.h
+
+ IDL_Files {
+ Hello.idl
+ }
+}
+
+project(Hello_Base_idl_gen) : componentidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_BASE_STUB_Export \
+ -Wb,stub_export_include=Hello_Base_stub_export.h \
+ -Wb,skel_export_macro=HELLO_BASE_SKEL_Export \
+ -Wb,skel_export_include=Hello_Base_skel_export.h \
+ -Wb,exec_export_macro=HELLO_BASE_EXEC_Export \
+ -Wb,exec_export_include=Hello_Base_exec_export.h
+
+ IDL_Files {
+ Hello_Base.idl
+ }
+}
+
+project(Hello_Base_stub) : ccm_stub, ami {
+ after += Hello_idl_gen Hello_Base_idl_gen
+ libs +=
+ libout = ../lib
+ libpaths += ../lib
+
+
+ sharedname = Hello_Base_stub
+ dynamicflags = HELLO_BASE_STUB_BUILD_DLL HELLO_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ HelloC.cpp
+ Hello_BaseC.cpp
+ }
+
+ Header_Files {
+ HelloC.h
+ Hello_BaseC.h
+ Hello_Base_stub_export.h
+ Hello_stub_export.h
+}
+
+ Inline_Files {
+ HelloC.inl
+ Hello_BaseC.inl
+ }
+}
+
+
+project(Hello_Base_skel) : ciao_executor, ami {
+ after += Hello_Base_stub
+ sharedname = Hello_Base_skel
+ libs += Hello_Base_stub
+ libout = ../lib
+ libpaths += ../lib
+
+
+ dynamicflags = HELLO_BASE_SKEL_BUILD_DLL HELLO_SKEL_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ HelloS.cpp
+ Hello_BaseS.cpp
+ }
+
+ Header_Files {
+ HelloS.h
+ Hello_BaseS.h
+ Hello_Base_skel_export.h
+ }
+
+ Inline_Files {
+ HelloS.inl
+ Hello_BaseS.inl
+ }
+}
+
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.idl b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.idl
new file mode 100644
index 00000000000..968d55a61cb
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.idl
@@ -0,0 +1,23 @@
+// $Id$
+
+#ifndef HELLO_RECEIVER_IDL
+#define HELLO_RECEIVER_IDL
+
+#include <Components.idl>
+
+#include "../Hello_Base/Hello_Base.idl"
+
+module Hello_AMI
+{
+ component Receiver
+ {
+ //provides
+ provides CCM_AMI::MyFoo do_my_foo;
+ provides CCM_AMI::MyInterface do_my_interface;
+ };
+
+ home ReceiverHome manages Receiver
+ {
+ };
+};
+#endif
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.mpc b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.mpc
new file mode 100644
index 00000000000..b72bb495c27
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver.mpc
@@ -0,0 +1,134 @@
+// $Id$
+// This file is generated with "generate_component_mpc.pl -p Hello_Base Hello_Receiver"
+
+project(Hello_Base_Hello_Receiver_idl_gen) : componentidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_RECEIVER_STUB_Export \
+ -Wb,stub_export_include=Hello_Receiver_stub_export.h \
+ -Wb,skel_export_macro=HELLO_RECEIVER_SVNT_Export \
+ -Wb,skel_export_include=Hello_Receiver_svnt_export.h \
+ -Wb,exec_export_macro=HELLO_RECEIVER_EXEC_Export \
+ -Wb,exec_export_include=Hello_Receiver_exec_export.h
+
+ IDL_Files {
+ Hello_Receiver.idl
+ }
+}
+
+project(Hello_Base_Hello_Receiver_lem_gen) : ciaoidldefaults {
+ after += Hello_Base_Hello_Receiver_idl_gen
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_RECEIVER_LEM_STUB_Export \
+ -Wb,stub_export_include=Hello_Receiver_lem_stub_export.h \
+ -SS -Gxhst
+
+ IDL_Files {
+ Hello_ReceiverE.idl
+ }
+}
+
+project(Hello_Base_Hello_Receiver_lem_stub) : ccm_svnt, ami {
+ after += Hello_Base_Hello_Receiver_lem_gen Hello_Base_Hello_Receiver_stub Hello_Base_stub
+ libs += Hello_Base_stub Hello_Receiver_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = Hello_Receiver_lem_stub
+ dynamicflags = HELLO_RECEIVER_LEM_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_ReceiverEC.cpp
+ }
+
+ Header_Files {
+ Hello_ReceiverEC.h
+ Hello_Receiver_lem_stub_export.h
+ }
+
+ Inline_Files {
+ Hello_ReceiverEC.inl
+ }
+}
+
+project(Hello_Base_Hello_Receiver_stub) : ccm_stub, ami {
+ after += Hello_Base_Hello_Receiver_idl_gen Hello_Base_stub
+ libs += Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = Hello_Receiver_stub
+ dynamicflags = HELLO_RECEIVER_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_ReceiverC.cpp
+ }
+
+ Header_Files {
+ Hello_ReceiverC.h
+ Hello_Receiver_stub_export.h
+ }
+
+ Inline_Files {
+ Hello_ReceiverC.inl
+ }
+}
+
+project(Hello_Base_Hello_Receiver_exec) : ciao_executor, ami {
+ after += Hello_Base_Hello_Receiver_lem_stub Hello_Base_Hello_Receiver_stub
+ sharedname = Hello_Receiver_exec
+ libs += Hello_Receiver_stub Hello_Receiver_lem_stub Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = HELLO_RECEIVER_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_Receiver_exec.cpp
+ }
+
+ Header_Files {
+ Hello_Receiver_exec.h
+ Hello_Receiver_exec_export.h
+ }
+
+ Inline_Files {
+ }
+}
+
+
+project(Hello_Base_Hello_Receiver_svnt) : ciao_servant, ami {
+ after += Hello_Base_skel Hello_Base_Hello_Receiver_lem_stub
+ sharedname = Hello_Receiver_svnt
+ libs += Hello_Receiver_stub Hello_Receiver_lem_stub \
+ Hello_Base_skel \
+ Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = HELLO_RECEIVER_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_ReceiverS.cpp
+ Hello_Receiver_svnt.cpp
+ }
+
+ Header_Files {
+ Hello_ReceiverS.h
+ Hello_Receiver_svnt.h
+ Hello_Receiver_svnt_export.h
+ }
+
+ Inline_Files {
+ Hello_ReceiverS.inl
+ }
+}
+
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.cpp b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.cpp
new file mode 100644
index 00000000000..abc08fcff35
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.cpp
@@ -0,0 +1,248 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// 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:1278
+
+#include "Hello_Receiver_exec.h"
+#include "ciao/CIAO_common.h"
+#include "ace/OS_NS_unistd.h"
+
+namespace CIAO_Hello_AMI_Receiver_Impl
+{
+ //============================================================
+ // Facet Executor Implementation Class: MyFoo_exec_i
+ //============================================================
+
+ MyFoo_exec_i::MyFoo_exec_i (void)
+ {
+ }
+
+ MyFoo_exec_i::~MyFoo_exec_i (void)
+ {
+ }
+
+ // Operations from ::CCM_AMI::MyFoo
+
+ ::CORBA::Long
+ MyFoo_exec_i::foo (
+ const char * in_str,
+ ::CORBA::String_out answer)
+ {
+ if (ACE_OS::strlen (in_str) == 0)
+ {
+ CCM_AMI::InternalException ex;
+ ex.id = 42;
+ ex.error_string = "Hello world";
+ throw CCM_AMI::InternalError (ex);
+ }
+ else
+ {
+ printf ("Receiver :\tReceived string <%s>\n", in_str);
+ ACE_OS::sleep (ACE_OS::rand () % 2);
+ answer = CORBA::string_dup ("This is my answer : Hi");
+ return ACE_OS::rand () % 100;
+ }
+ }
+
+ void
+ MyFoo_exec_i::hello (
+ CORBA::Long_out answer)
+ {
+ printf ("Receiver (HELLO) :\tReceived request\n");
+ ACE_OS::sleep (ACE_OS::rand () % 2);
+ answer = ACE_OS::rand () % 100;
+ }
+
+//============================================================
+ // Facet Executor Implementation Class: MyInterface_exec_i
+ //============================================================
+
+ MyInterface_exec_i::MyInterface_exec_i (void)
+ {
+ }
+
+ MyInterface_exec_i::~MyInterface_exec_i (void)
+ {
+ }
+
+ // Operations from ::CCM_AMI::MyInterface
+
+ CORBA::Float
+ MyInterface_exec_i::do_something_with_something (
+ CORBA::Short something)
+ {
+ if (something == 0)
+ {
+ CCM_AMI::InternalException ex;
+ ex.id = 42;
+ ex.error_string = "Hello world";
+ throw CCM_AMI::InternalError (ex);
+ }
+ else
+ {
+ printf ("Receiver :\tReceived short <%d>\n", something);
+ ACE_OS::sleep (ACE_OS::rand () % 2);
+ return static_cast<CORBA::Float>(something / 6.54321);
+ }
+ }
+
+ //============================================================
+ // Component Executor Implementation Class: Receiver_exec_i
+ //============================================================
+
+ Receiver_exec_i::Receiver_exec_i (void)
+ {
+ }
+
+ Receiver_exec_i::~Receiver_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ ::CCM_AMI::CCM_MyFoo_ptr
+ Receiver_exec_i::get_do_my_foo (void)
+ {
+ return new MyFoo_exec_i ();
+ }
+
+ ::CCM_AMI::CCM_MyInterface_ptr
+ Receiver_exec_i::get_do_my_interface (void)
+ {
+ return new MyInterface_exec_i ();
+ }
+
+ // Operations from Components::SessionComponent.
+
+ void
+ Receiver_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ ::Hello_AMI::CCM_Receiver_Context::_narrow (ctx);
+
+ if ( ::CORBA::is_nil (this->context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Receiver_exec_i::configuration_complete (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Receiver_exec_i::ccm_activate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Receiver_exec_i::ccm_passivate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Receiver_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_Receiver_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ Receiver_exec_i,
+ ::Components::EnterpriseComponent::_nil ());
+
+ return retval;
+ }
+}
+
+namespace CIAO_Hello_AMI_Receiver_Impl
+{
+ //============================================================
+ // Home Executor Implementation Class: ReceiverHome_exec_i
+ //============================================================
+
+ ReceiverHome_exec_i::ReceiverHome_exec_i (void)
+ {
+ }
+
+ ReceiverHome_exec_i::~ReceiverHome_exec_i (void)
+ {
+ }
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ ::Components::EnterpriseComponent_ptr
+ ReceiverHome_exec_i::create (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_THROW_EX (
+ retval,
+ Receiver_exec_i,
+ ::CORBA::NO_MEMORY ());
+
+ return retval;
+ }
+
+ extern "C" ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_ReceiverHome_Impl (void)
+ {
+ ::Components::HomeExecutorBase_ptr retval =
+ ::Components::HomeExecutorBase::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ ReceiverHome_exec_i,
+ ::Components::HomeExecutorBase::_nil ());
+
+ return retval;
+ }
+}
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.h b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.h
new file mode 100644
index 00000000000..512a7946f79
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Receiver/Hello_Receiver_exec.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// 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:1217
+
+#ifndef CIAO_HELLO_RECEIVER_EXEC_H_
+#define CIAO_HELLO_RECEIVER_EXEC_H_
+
+
+#include "Hello_ReceiverEC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "Hello_Receiver_exec_export.h"
+
+namespace CIAO_Hello_AMI_Receiver_Impl
+{
+ class MyFoo_exec_i
+ : public virtual ::CCM_AMI::CCM_MyFoo,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ MyFoo_exec_i (void);
+ virtual ~MyFoo_exec_i (void);
+
+ // Operations and attributes from ::CCM_AMI::MyFoo
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual ::CORBA::Long
+ foo (
+ const char * in_str,
+ ::CORBA::String_out answer);
+
+ virtual void
+ hello (
+ CORBA::Long_out answer);
+ };
+
+ class MyInterface_exec_i
+ : public virtual ::CCM_AMI::CCM_MyInterface,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ MyInterface_exec_i (void);
+ virtual ~MyInterface_exec_i (void);
+
+ // Operations and attributes from ::CCM_AMI::MyFoo
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual ::CORBA::Float
+ do_something_with_something (
+ CORBA::Short something);
+ };
+
+ class Receiver_exec_i
+ : public virtual Receiver_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ Receiver_exec_i (void);
+ virtual ~Receiver_exec_i (void);
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ virtual ::CCM_AMI::CCM_MyFoo_ptr
+ get_do_my_foo (void);
+
+ virtual ::CCM_AMI::CCM_MyInterface_ptr
+ get_do_my_interface (void);
+
+ // Operations from Components::SessionComponent.
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void configuration_complete (void);
+
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+
+ private:
+ ::Hello_AMI::CCM_Receiver_Context_var context_;
+ };
+
+ extern "C" HELLO_RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_Receiver_Impl (void);
+}
+
+namespace CIAO_Hello_AMI_Receiver_Impl
+{
+ class ReceiverHome_exec_i
+ : public virtual ReceiverHome_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ ReceiverHome_exec_i (void);
+
+ virtual ~ReceiverHome_exec_i (void);
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ virtual ::Components::EnterpriseComponent_ptr
+ create (void);
+ };
+
+ extern "C" HELLO_RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_ReceiverHome_Impl (void);
+}
+
+#endif /* ifndef */
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.idl b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.idl
new file mode 100644
index 00000000000..2df85da413f
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.idl
@@ -0,0 +1,32 @@
+// $Id$
+
+#ifndef HELLO_SENDER_IDL
+#define HELLO_SENDER_IDL
+
+#include <Components.idl>
+
+#include "../Hello_Base/Hello_Base.idl"
+
+module Hello_AMI
+{
+ component Sender
+ {
+ // for asynch invocation.
+ uses CCM_AMI::AMI_MyFoo run_asynch_my_foo;
+ uses CCM_AMI::AMI_MyInterface run_asynch_my_interface;
+
+ // for synchronous invocation
+ uses CCM_AMI::MyFoo run_my_foo;
+ uses CCM_AMI::MyInterface run_my_interface;
+
+ //provides the callback function/exception for the AMI component.
+ provides CCM_AMI::AMI_MyFoo_callback the_my_foo_callback;
+ provides CCM_AMI::AMI_MyInterface_callback the_my_interface_callback;
+ };
+
+ home SenderHome manages Sender
+ {
+ };
+};
+
+#endif
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.mpc b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.mpc
new file mode 100644
index 00000000000..cc08712425d
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender.mpc
@@ -0,0 +1,134 @@
+// $Id$
+// This file is generated with "generate_component_mpc.pl -p Hello_Base Hello_Sender"
+
+project(Hello_Base_Hello_Sender_idl_gen) : componentidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_SENDER_STUB_Export \
+ -Wb,stub_export_include=Hello_Sender_stub_export.h \
+ -Wb,skel_export_macro=HELLO_SENDER_SVNT_Export \
+ -Wb,skel_export_include=Hello_Sender_svnt_export.h \
+ -Wb,exec_export_macro=HELLO_SENDER_EXEC_Export \
+ -Wb,exec_export_include=Hello_Sender_exec_export.h
+
+ IDL_Files {
+ Hello_Sender.idl
+ }
+}
+
+project(Hello_Base_Hello_Sender_lem_gen) : ciaoidldefaults {
+ after += Hello_Base_Hello_Sender_idl_gen
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=HELLO_SENDER_LEM_STUB_Export \
+ -Wb,stub_export_include=Hello_Sender_lem_stub_export.h \
+ -SS -Gxhst
+
+ IDL_Files {
+ Hello_SenderE.idl
+ }
+}
+
+project(Hello_Base_Hello_Sender_lem_stub) : ccm_svnt, ami {
+ after += Hello_Base_Hello_Sender_lem_gen Hello_Base_Hello_Sender_stub Hello_Base_stub
+ libs += Hello_Base_stub Hello_Sender_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = Hello_Sender_lem_stub
+ dynamicflags = HELLO_SENDER_LEM_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_SenderEC.cpp
+ }
+
+ Header_Files {
+ Hello_SenderEC.h
+ Hello_Sender_lem_stub_export.h
+ }
+
+ Inline_Files {
+ Hello_SenderEC.inl
+ }
+}
+
+project(Hello_Base_Hello_Sender_stub) : ccm_stub, ami {
+ after += Hello_Base_Hello_Sender_idl_gen Hello_Base_stub
+ libs += Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ sharedname = Hello_Sender_stub
+ dynamicflags = HELLO_SENDER_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_SenderC.cpp
+ }
+
+ Header_Files {
+ Hello_SenderC.h
+ Hello_Sender_stub_export.h
+ }
+
+ Inline_Files {
+ Hello_SenderC.inl
+ }
+}
+
+project(Hello_Base_Hello_Sender_exec) : ciao_executor, ami {
+ after += Hello_Base_Hello_Sender_lem_stub Hello_Base_Hello_Sender_stub
+ sharedname = Hello_Sender_exec
+ libs += Hello_Sender_stub Hello_Sender_lem_stub Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = HELLO_SENDER_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_Sender_exec.cpp
+ }
+
+ Header_Files {
+ Hello_Sender_exec.h
+ Hello_Sender_exec_export.h
+ }
+
+ Inline_Files {
+ }
+}
+
+
+project(Hello_Base_Hello_Sender_svnt) : ciao_servant, ami {
+ after += Hello_Base_skel Hello_Base_Hello_Sender_lem_stub
+ sharedname = Hello_Sender_svnt
+ libs += Hello_Sender_stub Hello_Sender_lem_stub \
+ Hello_Base_skel \
+ Hello_Base_stub
+ libpaths += ../lib
+ libout = ../lib
+ dynamicflags = HELLO_SENDER_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Hello_SenderS.cpp
+ Hello_Sender_svnt.cpp
+ }
+
+ Header_Files {
+ Hello_SenderS.h
+ Hello_Sender_svnt.h
+ Hello_Sender_svnt_export.h
+ }
+
+ Inline_Files {
+ Hello_SenderS.inl
+ }
+}
+
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.cpp b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.cpp
new file mode 100644
index 00000000000..03347fc85e0
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.cpp
@@ -0,0 +1,371 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// 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:1278
+
+#include "Hello_Sender_exec.h"
+#include "ciao/CIAO_common.h"
+#include "ace/OS_NS_unistd.h"
+
+namespace CIAO_Hello_AMI_Sender_Impl
+{
+ //============================================================
+ // Facet Executor Implementation Class: MyFoo_callback_exec_i
+ //============================================================
+
+ MyFoo_callback_exec_i::MyFoo_callback_exec_i (void)
+ {
+ }
+
+ MyFoo_callback_exec_i::~MyFoo_callback_exec_i (void)
+ {
+ }
+
+ //============================================================
+ // Operations from ::CCM_AMI::MyFoo_callback
+ //============================================================
+
+ // FOO methods
+ void
+ MyFoo_callback_exec_i::foo_callback_handler (
+ ::CORBA::Long result,
+ const char * answer)
+ {
+ printf ("Sender (FOO) :\tCallback from AMI : result <%d> answer <%s>\n", result, answer);
+ }
+
+ void
+ MyFoo_callback_exec_i::foo_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder)
+ {
+ printf ("Sender (FOO) :\tCallback EXCEPTION from AMI : exception id : <%d> exception error : <%s>\n",
+ exception_holder.id, exception_holder.error_string.in ());
+ }
+
+ // HELLO methods
+ void
+ MyFoo_callback_exec_i::hello_callback_handler (
+ ::CORBA::Long answer)
+ {
+ printf ("Sender (FOO) :\tCallback from AMI (HELLO) : answer <%d>\n", answer);
+ }
+
+ void
+ MyFoo_callback_exec_i::hello_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder)
+ {
+ printf ("Sender (FOO) :\tCallback EXCEPTION from AMI (HELLO) : exception id : <%d> exception error : <%s>\n",
+ exception_holder.id, exception_holder.error_string.in ());
+ }
+
+ //============================================================
+ // Operations from ::CCM_AMI::MyInterface_callback
+ //============================================================
+ MyInterface_callback_exec_i::MyInterface_callback_exec_i ()
+ {
+ }
+
+ MyInterface_callback_exec_i::~MyInterface_callback_exec_i ()
+ {
+ }
+
+ void
+ MyInterface_callback_exec_i::do_something_with_something_callback_handler (
+ ::CORBA::Float result)
+ {
+ printf ("Sender (INTERFACE) :\tCallback from AMI : result <%f>\n", result);
+ }
+
+ void
+ MyInterface_callback_exec_i::do_something_with_something_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder)
+ {
+ printf ("Sender (INTERFACE) :\tCallback EXCEPTION from AMI : exception id : <%d> exception error : <%s>\n",
+ exception_holder.id, exception_holder.error_string.in ());
+ }
+
+ //============================================================
+ // Worker thread for asynchronous invocations for MyFoo
+ //============================================================
+ asynch_foo_generator::asynch_foo_generator (::CCM_AMI::AMI_MyFoo_ptr my_foo_ami)
+ : my_foo_ami_ (::CCM_AMI::AMI_MyFoo::_duplicate (my_foo_ami))
+ {
+ }
+
+ int asynch_foo_generator::svc ()
+ {
+ ACE_OS::sleep (3);
+ for (int i = 0; i < 5; ++i)
+ {
+ if (CORBA::is_nil (my_foo_ami_))
+ {
+ printf ("Sender (ASYNCH) :\tfoo_ami is NIL !!!\n");
+ return 1;
+ }
+ else
+ {
+ printf ("Sender (ASYNCH) :\tInvoke Asynchronous call\n");
+ my_foo_ami_->sendc_foo ("Do something asynchronous");
+ my_foo_ami_->sendc_hello ();
+ printf ("Sender (ASYNCH) :\tInvoked Asynchronous call\n");
+ }
+ }
+ printf ("Sender (ASYNCH) :\tInvoke Asynchronous call to test EXCEPTION HANDLING\n");
+ my_foo_ami_->sendc_foo ("");
+ printf ("Sender (ASYNCH) :\tInvoked Asynchronous call.\n");
+ return 0;
+ }
+
+ //============================================================
+ // Worker thread for synchronous invocations for MyFoo
+ //============================================================
+ synch_foo_generator::synch_foo_generator (::CCM_AMI::MyFoo_ptr my_foo_ami)
+ : my_foo_ami_ (::CCM_AMI::MyFoo::_duplicate (my_foo_ami))
+ {
+ }
+
+ int synch_foo_generator::svc ()
+ {
+ ACE_OS::sleep (3);
+ //run synch calls
+ char * out_str;
+ for (int i = 0; i < 5; ++i)
+ {
+ CORBA::Long result = my_foo_ami_->foo ("Do something synchronous", out_str);
+ printf ("Sender (SYNCH):\tInvoked synchronous call (FOO) result <%d> answer <%s>\n", result, out_str);
+ CORBA::Long answer;
+ my_foo_ami_->hello (answer);
+ printf ("Sender (SYNCH):\tInvoked synchronous call (HELLO) answer <%d>\n", answer);
+ }
+ try
+ {
+ CORBA::Long result = my_foo_ami_->foo ("", out_str);
+ printf ("Sender (SYNCH) :\tInvoked synchronous call result <%d> answer <%s>\n", result, out_str);
+ }
+ catch (CCM_AMI::InternalError& ex)
+ {
+ printf ("Sender (SYNCH) :\tExpected Exception caught : <%d> <%s>\n", ex.ex.id, ex.ex.error_string.in ());
+ }
+ return 0;
+ }
+
+ //============================================================
+ // Worker thread for asynchronous invocations for MyInterface
+ //============================================================
+ asynch_interface_generator::asynch_interface_generator (::CCM_AMI::AMI_MyInterface_ptr my_interface_ami)
+ : my_interface_ami_ (::CCM_AMI::AMI_MyInterface::_duplicate (my_interface_ami))
+ {
+ }
+
+ int asynch_interface_generator::svc ()
+ {
+ ACE_OS::sleep (3);
+ for (int i = 1; i < 15; ++i)
+ {
+ if (CORBA::is_nil (my_interface_ami_))
+ {
+ printf ("Sender (INTERFACE) :\tinterface_ami is NIL !!!\n");
+ return 1;
+ }
+ else
+ {
+ printf ("Sender (INTERFACE) :\tInvoke Asynchronous call\n");
+ //MyInterface_callback_exec_i* cb = new MyInterface_callback_exec_i ();
+ my_interface_ami_->sendc_do_something_with_something (0, i);
+ printf ("Sender (INTERFACE) :\tInvoked Asynchronous call\n");
+ }
+ }
+ printf ("Sender (INTERFACE) :\tInvoke Asynchronous call to test EXCEPTION HANDLING\n");
+ my_interface_ami_->sendc_do_something_with_something (0, 0);
+ printf ("Sender (INTERFACE) :\tInvoked Asynchronous call.\n");
+ return 0;
+ }
+
+ //============================================================
+ // Component Executor Implementation Class: Sender_exec_i
+ //============================================================
+ Sender_exec_i::Sender_exec_i (void)
+ : global_foo_callback_ (0),
+ global_interface_callback_ (0)
+ {
+ }
+
+ Sender_exec_i::~Sender_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ ::CCM_AMI::CCM_AMI_MyFoo_callback_ptr
+ Sender_exec_i::get_the_my_foo_callback ()
+ {
+ if (CORBA::is_nil (global_foo_callback_))
+ {
+ global_foo_callback_ = new MyFoo_callback_exec_i ();
+ }
+
+ return global_foo_callback_;
+ }
+
+ ::CCM_AMI::CCM_AMI_MyInterface_callback_ptr
+ Sender_exec_i::get_the_my_interface_callback ()
+ {
+ if (CORBA::is_nil (global_interface_callback_))
+ {
+ global_interface_callback_ = new MyInterface_callback_exec_i ();
+ }
+
+ return global_interface_callback_;
+ }
+
+ // Operations from Components::SessionComponent.
+
+ void
+ Sender_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ ::Hello_AMI::CCM_Sender_Context::_narrow (ctx);
+ if ( ::CORBA::is_nil (this->context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Sender_exec_i::configuration_complete (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Sender_exec_i::ccm_activate (void)
+ {
+
+ ::CCM_AMI::AMI_MyFoo_var asynch_foo =
+ this->context_->get_connection_run_asynch_my_foo();
+ asynch_foo_generator* asynch_foo_gen =
+ new asynch_foo_generator (asynch_foo);
+ asynch_foo_gen->activate (THR_NEW_LWP | THR_JOINABLE, 1);
+
+ ::CCM_AMI::MyFoo_var synch_foo =
+ this->context_->get_connection_run_my_foo ();
+ synch_foo_generator* synch_foo_gen =
+ new synch_foo_generator (synch_foo);
+ synch_foo_gen->activate (THR_NEW_LWP | THR_JOINABLE, 1);
+
+ ::CCM_AMI::AMI_MyInterface_var asynch_interface =
+ this->context_->get_connection_run_asynch_my_interface();
+ asynch_interface_generator* asynch_interface_gen =
+ new asynch_interface_generator (asynch_interface);
+ asynch_interface_gen->activate (THR_NEW_LWP | THR_JOINABLE, 1);
+
+ }
+
+ void
+ Sender_exec_i::ccm_passivate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Sender_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_Sender_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ Sender_exec_i,
+ ::Components::EnterpriseComponent::_nil ());
+
+ return retval;
+ }
+}
+
+namespace CIAO_Hello_AMI_Sender_Impl
+{
+ //============================================================
+ // Home Executor Implementation Class: SenderHome_exec_i
+ //============================================================
+
+ SenderHome_exec_i::SenderHome_exec_i (void)
+ {
+ }
+
+ SenderHome_exec_i::~SenderHome_exec_i (void)
+ {
+ }
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ ::Components::EnterpriseComponent_ptr
+ SenderHome_exec_i::create (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_THROW_EX (
+ retval,
+ Sender_exec_i,
+ ::CORBA::NO_MEMORY ());
+
+ return retval;
+ }
+
+ extern "C" ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_SenderHome_Impl (void)
+ {
+ ::Components::HomeExecutorBase_ptr retval =
+ ::Components::HomeExecutorBase::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ SenderHome_exec_i,
+ ::Components::HomeExecutorBase::_nil ());
+
+ return retval;
+ }
+}
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.h b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.h
new file mode 100644
index 00000000000..302e6577590
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/Sender/Hello_Sender_exec.h
@@ -0,0 +1,214 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 ****
+// 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
+// http://doc.ece.uci.edu/
+// 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:1217
+
+#ifndef CIAO_HELLO_SENDER_EXEC_H_
+#define CIAO_HELLO_SENDER_EXEC_H_
+
+
+#include "Hello_SenderEC.h"
+#include "Hello_Sender_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "ace/Task.h"
+
+
+namespace CIAO_Hello_AMI_Sender_Impl
+{
+ // Worker thread for asynchronous invocations
+ class asynch_foo_generator : public virtual ACE_Task_Base
+ {
+ public:
+ asynch_foo_generator (::CCM_AMI::AMI_MyFoo_ptr my_foo_ami);
+
+ virtual int svc (void);
+
+ private:
+ ::CCM_AMI::AMI_MyFoo_var my_foo_ami_;
+ };
+
+ // Worker thread for synchronous invocations
+ class synch_foo_generator : public virtual ACE_Task_Base
+ {
+ public:
+ synch_foo_generator (::CCM_AMI::MyFoo_ptr my_foo_ami);
+
+ virtual int svc (void);
+
+ private:
+ ::CCM_AMI::MyFoo_var my_foo_ami_;
+ };
+
+ // Worker thread for synchronous invocations
+ class asynch_interface_generator : public virtual ACE_Task_Base
+ {
+ public:
+ asynch_interface_generator (::CCM_AMI::AMI_MyInterface_ptr my_interface_ami);
+
+ virtual int svc (void);
+
+ private:
+ ::CCM_AMI::AMI_MyInterface_ptr my_interface_ami_;
+ };
+
+ class MyInterface_callback_exec_i
+ : public virtual ::CCM_AMI::CCM_AMI_MyInterface_callback,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ MyInterface_callback_exec_i (void);
+ virtual ~MyInterface_callback_exec_i (void);
+
+ // Operations and attributes from ::CCM_AMI::MyFoo_callback
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual void
+ do_something_with_something_callback_handler (
+ ::CORBA::Float result);
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual void
+ do_something_with_something_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder);
+ };
+
+ class MyFoo_callback_exec_i
+ : public virtual ::CCM_AMI::CCM_AMI_MyFoo_callback,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ MyFoo_callback_exec_i (void);
+ virtual ~MyFoo_callback_exec_i (void);
+
+ // Operations and attributes from ::CCM_AMI::MyFoo_callback
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual void
+ foo_callback_handler (
+ ::CORBA::Long result,
+ const char * answer);
+
+ virtual void
+ hello_callback_handler (
+ ::CORBA::Long answer);
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual void
+ foo_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder);
+
+ virtual void
+ hello_callback_excep (
+ const ::CCM_AMI::InternalException & exception_holder);
+
+ };
+
+ class Sender_exec_i
+ : public virtual Sender_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ Sender_exec_i (void);
+ virtual ~Sender_exec_i (void);
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // Port operations.
+
+ virtual ::CCM_AMI::CCM_AMI_MyFoo_callback_ptr
+ get_the_my_foo_callback (void);
+
+ virtual ::CCM_AMI::CCM_AMI_MyInterface_callback_ptr
+ get_the_my_interface_callback (void);
+
+ // Operations from Components::SessionComponent.
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void configuration_complete (void);
+
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+
+ private:
+ ::Hello_AMI::CCM_Sender_Context_var context_;
+ MyFoo_callback_exec_i* global_foo_callback_;
+ MyInterface_callback_exec_i* global_interface_callback_;
+ };
+
+ extern "C" HELLO_SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Hello_AMI_Sender_Impl (void);
+}
+
+namespace CIAO_Hello_AMI_Sender_Impl
+{
+ class SenderHome_exec_i
+ : public virtual SenderHome_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ SenderHome_exec_i (void);
+
+ virtual ~SenderHome_exec_i (void);
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ virtual ::Components::EnterpriseComponent_ptr
+ create (void);
+ };
+
+ extern "C" HELLO_SENDER_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_Hello_AMI_SenderHome_Impl (void);
+}
+
+#endif /* ifndef */
+
diff --git a/modules/CIAO/connectors/ami4ccm/examples/descriptors/Plan.cdp b/modules/CIAO/connectors/ami4ccm/examples/descriptors/Plan.cdp
new file mode 100644
index 00000000000..b5bc39c48ce
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/descriptors/Plan.cdp
@@ -0,0 +1,449 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:DeploymentPlan xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+
+ <UUID>6D382DAE-9024-4C4D-B91B-A0F9176AFACF</UUID>
+
+ <implementation xmi:id="Hello_ReceiverHomeImplementation">
+ <name>Hello_ReceiverHomeImplementation</name>
+ <source/>
+ <artifact xmi:idref="Hello_Receiver_ExecArtifact"/>
+ <artifact xmi:idref="Hello_Receiver_SvntArtifact"/>
+ <execParameter>
+ <name>component factory</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_Receiver_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_exec</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_Receiver_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_svnt</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
+ <implementation xmi:id="Hello_SenderHomeImplementation">
+ <name>Hello_SenderHomeImplementation</name>
+ <source/>
+ <artifact xmi:idref="Hello_Sender_ExecArtifact"/>
+ <artifact xmi:idref="Hello_Sender_SvntArtifact"/>
+ <execParameter>
+ <name>component factory</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_Sender_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.SenderArtifacts.Sender_exec</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_Sender_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.SenderArtifacts.Sender_svnt</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
+ <implementation xmi:id="Hello_AMIHomeImplementation">
+ <name>Hello_AMIHomeImplementation</name>
+ <source/>
+ <artifact xmi:idref="Hello_AMI_ExecArtifact"/>
+ <artifact xmi:idref="Hello_AMI_SvntArtifact"/>
+ <execParameter>
+ <name>component factory</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_AMI_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.AMIArtifacts.AMI_exec</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_AMI_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Hello.ImplementationArtifacts.AMIArtifacts.AMI_svnt</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
+ <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver">
+ <name>Hello.ComponentImplementations.HelloImplementation.Hello.Receiver</name>
+ <node>Receiver</node>
+ <source/>
+ <implementation xmi:idref="Hello_ReceiverHomeImplementation"/>
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Receiver.ior</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
+
+ <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.Sender">
+ <name>Hello.ComponentImplementations.HelloImplementation.Hello.Sender</name>
+ <node>Sender</node>
+ <source/>
+ <implementation xmi:idref="Hello_SenderHomeImplementation"/>
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Sender.ior</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
+
+ <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.AMI">
+ <name>Hello.ComponentImplementations.HelloImplementation.Hello.AMI</name>
+ <node>AMI</node>
+ <source/>
+ <implementation xmi:idref="Hello_AMIHomeImplementation"/>
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>AMI.ior</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
+
+ <connection>
+ <name>run_asynch_foo_connection</name>
+ <internalEndpoint>
+ <portName>perform_asynch_my_foo</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>run_asynch_my_foo</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>foo_callback_connection</name>
+ <internalEndpoint>
+ <portName>the_my_foo_callback</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>callback_my_foo</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>do_foo_connection</name>
+ <internalEndpoint>
+ <portName>do_my_foo</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>my_foo_receiver</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>synch_foo_connection</name>
+ <internalEndpoint>
+ <portName>do_my_foo</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>run_my_foo</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>run_asynch_interface_connection</name>
+ <internalEndpoint>
+ <portName>perform_asynch_my_interface</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>run_asynch_my_interface</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>interface_callback_connection</name>
+ <internalEndpoint>
+ <portName>the_my_interface_callback</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>callback_my_interface</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>do_interface_connection</name>
+ <internalEndpoint>
+ <portName>do_my_interface</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>my_interface_receiver</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" />
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>synch_interface_connection</name>
+ <internalEndpoint>
+ <portName>do_my_interface</portName>
+ <provider>true</provider>
+ <kind>Facet</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" />
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>run_my_interface</portName>
+ <provider>false</provider>
+ <kind>SimplexReceptacle</kind>
+ <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" />
+ </internalEndpoint>
+ </connection>
+
+ <artifact xmi:id="Hello_AMI_SvntArtifact">
+ <name>Hello.ImplementationArtifacts.AMIArtifacts.AMI_svnt</name>
+ <source/>
+ <node/>
+ <location>AMI_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_AMIHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact xmi:id="Hello_AMI_ExecArtifact">
+ <name>Hello.ImplementationArtifacts.AMIArtifacts.AMI_exec</name>
+ <source/>
+ <node/>
+ <location>AMI_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_AMIHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact xmi:id="Hello_Receiver_SvntArtifact">
+ <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_svnt</name>
+ <source/>
+ <node/>
+ <location>Hello_Receiver_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_ReceiverHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact xmi:id="Hello_Receiver_ExecArtifact">
+ <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_exec</name>
+ <source/>
+ <node/>
+ <location>Hello_Receiver_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_ReceiverHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact xmi:id="Hello_Sender_SvntArtifact">
+ <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_svnt</name>
+ <source/>
+ <node/>
+ <location>Hello_Sender_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_SenderHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact xmi:id="Hello_Sender_ExecArtifact">
+ <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_exec</name>
+ <source/>
+ <node/>
+ <location>Hello_Sender_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Hello_AMI_SenderHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+</Deployment:DeploymentPlan>
diff --git a/modules/CIAO/connectors/ami4ccm/examples/descriptors/run_test.pl b/modules/CIAO/connectors/ami4ccm/examples/descriptors/run_test.pl
new file mode 100755
index 00000000000..fbfa5743e5b
--- /dev/null
+++ b/modules/CIAO/connectors/ami4ccm/examples/descriptors/run_test.pl
@@ -0,0 +1,206 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{'ACE_ROOT'}/bin";
+use PerlACE::Run_Test;
+
+$CIAO_ROOT = "$ENV{'CIAO_ROOT'}";
+$TAO_ROOT = "$ENV{'TAO_ROOT'}";
+$DAnCE = "$ENV{'DANCE_ROOT'}";
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$daemons = 3;
+@ports = ( 60000, 60001, 60002 );
+@iorfiles = ( "AMI.ior", "Sender.ior", "Receiver.ior" );
+@nodenames = ( "AMI", "Sender", "Receiver" );
+
+$status = 0;
+$cdp_file = "Plan.cdp";
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+
+PerlACE::add_lib_path ('../lib');
+$ENV{"DANCE_TRACE_ENABLE"} = 0;
+$ENV{"CIAO_TRACE_ENABLE"} = 0;
+
+unlink $nsior;
+
+$E = 0;
+$EM = 0;
+
+# Delete if there are any .ior files.
+sub delete_ior_files {
+ for ($i = 0; $i < $daemons; ++$i) {
+ unlink $iorfiles[$i];
+ }
+ unlink PerlACE::LocalFile ("EM.ior");
+ unlink PerlACE::LocalFile ("Receiver.ior");
+ unlink PerlACE::LocalFile ("Sender.ior");
+ unlink PerlACE::LocalFile ("foo.ior");
+ unlink PerlACE::LocalFile ("AMI.ior");
+ unlink PerlACE::LocalFile ("ns.ior");
+}
+
+sub kill_node_daemons {
+ for ($i = 0; $i < $daemons; ++$i) {
+ $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1);
+ }
+}
+
+sub kill_open_processes {
+ if ($daemons_running == 1) {
+ kill_node_daemons ();
+ }
+
+ if ($em_running == 1) {
+ $EM->Kill ();
+ $EM->TimedWait (1);
+ }
+
+ if ($ns_running == 1) {
+ $NS->Kill ();
+ $NS->TimedWait (1);
+ }
+
+}
+
+sub run_node_daemons {
+ for ($i = 0; $i < $daemons; ++$i)
+ {
+ $iorfile = $iorfiles[$i];
+ $port = $ports[$i];
+ $nodename = $nodenames[$i];
+ $iiop = "iiop://localhost:$port";
+ $node_app = "$CIAO_ROOT/bin/ciao_componentserver";
+
+ $d_cmd = "$DAnCE/bin/dance_node_manager";
+ $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService";
+
+ print "Run dance_node_manager with $d_param\n";
+
+ $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param);
+ $result = $Daemons[$i]->Spawn ();
+ push(@processes, $Daemons[$i]);
+
+ if (PerlACE::waitforfile_timed ($iorfile,
+ 30) == -1) {
+ print STDERR
+ "ERROR: The ior $iorfile file of node daemon $i could not be found\n";
+ for (; $i >= 0; --$i) {
+ $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1);
+ }
+ return -1;
+ }
+ }
+ return 0;
+}
+
+delete_ior_files ();
+
+# Invoke naming service
+
+$NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 1 -ORBEndpoint iiop://localhost:60003 -o ns.ior");
+
+$NS->Spawn ();
+
+print STDERR "Starting Naming Service with -m 1 -ORBEndpoint iiop://localhost:60003 -o ns.ior\n";
+
+if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1)
+{
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$ns_running = 1;
+
+# Set up NamingService environment
+$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService";
+
+
+# Invoke node daemons.
+print "Invoking node daemons\n";
+$status = run_node_daemons ();
+
+if ($status != 0) {
+ print STDERR "ERROR: Unable to execute the node daemons\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+$daemons_running = 1;
+
+# Invoke execution manager.
+print "Invoking execution manager (dance_execution_manager.exe) with -eEM.ior \n";
+$EM = new PerlACE::Process ("$DAnCE/bin/dance_execution_manager",
+ "-eEM.ior --domain-nc corbaloc:rir:/NameService");
+$EM->Spawn ();
+
+if (PerlACE::waitforfile_timed ("EM.ior",
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR
+ "ERROR: The ior file of execution manager could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+$em_running = 1;
+
+# Invoke executor - start the application -.
+print "Invoking executor - start the application -\n";
+
+print "Start dance_plan_launcher.exe with -x $cdp_file -k file://EM.ior\n";
+$E =
+ new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher",
+ "-x $cdp_file -k file://EM.ior");
+
+$E->SpawnWaitKill (50);
+
+if (PerlACE::waitforfile_timed (
+ "Receiver.ior",
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: The ior file of receiver could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ("Sender.ior",
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: The ior file of sender could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ("AMI.ior",
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: The ior file of AMI could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+print "Sleeping 30 seconds to allow task to complete\n";
+sleep (30);
+
+# Invoke executor - stop the application -.
+print "Invoking executor - stop the application -\n";
+print "by running dance_plan_launcher.exe with -k file://EM.ior -x $cdp_file -q\n";
+
+$E =
+ new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher",
+ "-k file://EM.ior -x $cdp_file -q");
+$E->SpawnWaitKill (30);
+
+print "Executor returned.\n";
+print "Shutting down rest of the processes.\n";
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;