From 5d9e2d5d118045b375501302ee0e24f7ed2b980b Mon Sep 17 00:00:00 2001 From: "William R. Otte" Date: Tue, 10 Feb 2009 19:16:25 +0000 Subject: ChangeLogTag: Tue Feb 10 19:13:45 UTC 2009 William R. Otte --- flat/CIAO/ChangeLog | 39 +- .../CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp | 7 +- flat/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp | 2 +- .../test.cpp | 2 +- flat/CIAO/VERSION | 2 +- .../ciao/Containers/Session/Session_Container.cpp | 3 +- flat/CIAO/ciao/Version.h | 2 +- flat/CIAO/examples/DevGuideExamples/CIAO.mwc | 5 + .../DevGuideExamples/Messenger/Administrator.cidl | 24 + .../DevGuideExamples/Messenger/Administrator.idl | 24 + .../DevGuideExamples/Messenger/Administrator.mpc | 121 ++++ .../Messenger/Administrator_Client.cpp | 120 ++++ .../Messenger/Administrator_Client_IDL2.cpp | 10 + .../Messenger/Administrator_Client_IDL2.mpc | 45 ++ .../Messenger/Administrator_Client_IDL3.cpp | 10 + .../Messenger/Administrator_Client_IDL3.mpc | 29 + .../Messenger/Administrator_exec_export.h | 58 ++ .../Messenger/Administrator_exec_i.cpp | 259 +++++++ .../Messenger/Administrator_exec_i.h | 112 +++ .../Messenger/Administrator_stub_export.h | 58 ++ .../Messenger/Administrator_svnt_export.h | 58 ++ .../DevGuideExamples/Messenger/History.idl | 19 + .../DevGuideExamples/Messenger/History_exec_i.cpp | 96 +++ .../DevGuideExamples/Messenger/History_exec_i.h | 72 ++ .../DevGuideExamples/Messenger/Message.idl | 21 + .../DevGuideExamples/Messenger/Messenger.cidl | 24 + .../DevGuideExamples/Messenger/Messenger.idl | 30 + .../DevGuideExamples/Messenger/Messenger.mpc | 153 ++++ .../Messenger/Messenger_exec_export.h | 58 ++ .../Messenger/Messenger_exec_i.cpp | 254 +++++++ .../DevGuideExamples/Messenger/Messenger_exec_i.h | 136 ++++ .../Messenger/Messenger_stub_export.h | 58 ++ .../Messenger/Messenger_svnt_export.h | 58 ++ .../DevGuideExamples/Messenger/Publication.idl | 17 + .../Messenger/Publication_exec_i.cpp | 85 +++ .../Messenger/Publication_exec_i.h | 75 ++ .../DevGuideExamples/Messenger/Receiver.cidl | 23 + .../DevGuideExamples/Messenger/Receiver.idl | 23 + .../DevGuideExamples/Messenger/Receiver.mpc | 121 ++++ .../Messenger/Receiver_exec_export.h | 58 ++ .../DevGuideExamples/Messenger/Receiver_exec_i.cpp | 178 +++++ .../DevGuideExamples/Messenger/Receiver_exec_i.h | 105 +++ .../Messenger/Receiver_stub_export.h | 58 ++ .../Messenger/Receiver_svnt_export.h | 58 ++ .../DevGuideExamples/Messenger/Runnable.idl | 17 + .../DevGuideExamples/Messenger/Runnable_exec_i.cpp | 61 ++ .../DevGuideExamples/Messenger/Runnable_exec_i.h | 68 ++ .../StaticDAnCE/Messenger_StaticDAnCE.mpc | 18 + .../Messenger/StaticDAnCE/README.txt | 35 + .../Messenger/StaticDAnCE/StaticDAnCEApp.cpp | 102 +++ .../DevGuideExamples/Messenger/StaticDAnCE/plan.h | 47 ++ .../Messenger/StaticDAnCE/run_test.pl | 110 +++ .../Messenger/descriptors/Administrator.ccd | 47 ++ .../Messenger/descriptors/Administrator.cid | 34 + .../Messenger/descriptors/Administrator.cpd | 15 + .../Messenger/descriptors/Administrator_Exec.iad | 40 ++ .../Messenger/descriptors/Administrator_Stub.iad | 30 + .../Messenger/descriptors/Administrator_Svnt.iad | 40 ++ .../descriptors/Application-flattened.cdp | 255 +++++++ .../Messenger/descriptors/Application.cdp | 25 + .../Messenger/descriptors/Application.pcd | 23 + .../Messenger/descriptors/ApplicationNodeMap.dat | 5 + .../Messenger/descriptors/Deployment.xsd | 776 +++++++++++++++++++++ .../Messenger/descriptors/Domain.cdd | 24 + .../Messenger/descriptors/Libraries.iad | 11 + .../Messenger/descriptors/Messenger.ccd | 90 +++ .../Messenger/descriptors/Messenger.cid | 37 + .../Messenger/descriptors/Messenger.cpd | 15 + .../Messenger/descriptors/MessengerAssembly.ccd | 31 + .../Messenger/descriptors/MessengerAssembly.cid | 110 +++ .../Messenger/descriptors/MessengerAssembly.cpd | 13 + .../Messenger/descriptors/Messenger_Exec.iad | 40 ++ .../Messenger/descriptors/Messenger_Stub.iad | 25 + .../Messenger/descriptors/Messenger_Svnt.iad | 40 ++ .../Messenger/descriptors/README_15a | 5 + .../Messenger/descriptors/Receiver.ccd | 48 ++ .../Messenger/descriptors/Receiver.cid | 34 + .../Messenger/descriptors/Receiver.cpd | 11 + .../Messenger/descriptors/Receiver_Exec.iad | 40 ++ .../Messenger/descriptors/Receiver_Stub.iad | 29 + .../Messenger/descriptors/Receiver_Svnt.iad | 40 ++ .../DevGuideExamples/Messenger/descriptors/XMI.xsd | 35 + .../Messenger/descriptors/admin.dat | 7 + .../Messenger/descriptors/package.tpd | 8 + .../Messenger/descriptors/run_test.pl | 117 ++++ flat/CIAO/examples/DevGuideExamples/readme.txt | 12 + 86 files changed, 5331 insertions(+), 9 deletions(-) create mode 100644 flat/CIAO/examples/DevGuideExamples/CIAO.mwc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/History.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Message.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Publication.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd create mode 100644 flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl create mode 100644 flat/CIAO/examples/DevGuideExamples/readme.txt diff --git a/flat/CIAO/ChangeLog b/flat/CIAO/ChangeLog index 7f16993e8f9..dfcffd97896 100644 --- a/flat/CIAO/ChangeLog +++ b/flat/CIAO/ChangeLog @@ -1,3 +1,38 @@ +Tue Feb 10 19:13:45 UTC 2009 William R. Otte + + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * ciao/Containers/Session/Session_Container.cpp: + + Loffinf changes. + + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + + compile fixes to the last commit. + + * VERSION: + * ciao/Version.h: + + Updated version number to current. + + * examples/DevGuideExamples: + * examples/DevGuideExamples/Messenger/Administrator.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.h: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Messenger.mpc: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.h: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Receiver.mpc: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.h: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp: + * examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc: + * examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat: + * examples/DevGuideExamples/Messenger/descriptors/run_test.pl: + + Partially ported this example. + Tue Feb 10 18:18:41 UTC 2009 William R. Otte * DAnCE/Deployment/Deployment.idl: @@ -138,8 +173,8 @@ Tue Feb 10 18:18:41 UTC 2009 William R. Otte * tools/IDL3_to_IDL2/cdmw_idl.cpp: * tools/XML/XercesString.cpp: - Fuzz. - + Fuzz. + Fri Feb 6 22:06:51 UTC 2009 William R. Otte * bin/ciao_tests.lst: diff --git a/flat/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp b/flat/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp index 62c837b67dd..1df77501dd6 100644 --- a/flat/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp +++ b/flat/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp @@ -542,14 +542,17 @@ DAnCE_NodeManager_Module::create_object (CORBA::ORB_ptr orb, "Error: Unable to write IOR to file %C\n", node_file.c_str ())); } - + // Activate POA manager PortableServer::POAManager_var mgr = this->root_poa_->the_POAManager (); mgr->activate (); // Finishing Deployment part - DANCE_DEBUG ((LM_DEBUG, DLINFO "DAnCE_NodeManager_Module::create_object - " + DANCE_DEBUG ((LM_NOTICE, DLINFO "DAnCE_NodeManager_Module::create_object - " "DAnCE_NodeManager is running...\n")); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "DAnCE_NodeManager_Module::create_object - " + "NodeManager IOR: %s\n", ior.in ())); return nm_obj._retn (); } diff --git a/flat/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp b/flat/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp index 66889771759..3fd058f2131 100644 --- a/flat/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp +++ b/flat/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp @@ -2,7 +2,7 @@ #include "tools/Config_Handlers/XML_File_Intf.h" #include "DAnCE/Logger/Log_Macros.h" -int ACE_TMAIN (int argc, char * ACE_TCHAR[]) +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) { try { diff --git a/flat/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp b/flat/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp index c26ee9ea7a1..727f691b970 100644 --- a/flat/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp +++ b/flat/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp @@ -2,7 +2,7 @@ #include "DAnCE/Deployment/Deployment_NodeApplicationC.h" #include "DAnCE/Logger/Log_Macros.h" -int ACE_TMAIN (int argc, char * ACE_TCHAR[]) +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) { try { diff --git a/flat/CIAO/VERSION b/flat/CIAO/VERSION index 756f4305c80..ecb3858e39e 100644 --- a/flat/CIAO/VERSION +++ b/flat/CIAO/VERSION @@ -1,4 +1,4 @@ -This is CIAO version 0.6.3, released Thu Feb 21 02:34:37 CST 2008 +This is CIAO version 0.6.8, released Mon Feb 09 12:01:28 CST 2009 If you have any problems with or questions about CIAO, please send e-mail to the CIAO mailing list (ciao-users@cs.wustl.edu), using the diff --git a/flat/CIAO/ciao/Containers/Session/Session_Container.cpp b/flat/CIAO/ciao/Containers/Session/Session_Container.cpp index 6867fd1c8b4..2d021a58255 100644 --- a/flat/CIAO/ciao/Containers/Session/Session_Container.cpp +++ b/flat/CIAO/ciao/Containers/Session/Session_Container.cpp @@ -558,9 +558,10 @@ namespace CIAO // standard forbids casting a pointer-to-object (including // void*) directly to a pointer-to-function. void *void_ptr = executor_dll.symbol (entry_point); + ACE_DEBUG ((LM_EMERGENCY, "***** vp: %u\n", void_ptr)); ptrdiff_t tmp_ptr = reinterpret_cast (void_ptr); ccreator = reinterpret_cast (tmp_ptr); - + ACE_DEBUG ((LM_EMERGENCY, "***** cc: %u\n", ccreator)); void_ptr = servant_dll.symbol (servant_entrypoint); tmp_ptr = reinterpret_cast (void_ptr); screator = reinterpret_cast (tmp_ptr); diff --git a/flat/CIAO/ciao/Version.h b/flat/CIAO/ciao/Version.h index 7609359068f..2cf6e336e89 100644 --- a/flat/CIAO/ciao/Version.h +++ b/flat/CIAO/ciao/Version.h @@ -5,5 +5,5 @@ #define CIAO_MAJOR_VERSION 0 #define CIAO_MINOR_VERSION 6 -#define CIAO_BETA_VERSION 3 +#define CIAO_BETA_VERSION 8 #define CIAO_VERSION "0.6.3" diff --git a/flat/CIAO/examples/DevGuideExamples/CIAO.mwc b/flat/CIAO/examples/DevGuideExamples/CIAO.mwc new file mode 100644 index 00000000000..dd297256b34 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/CIAO.mwc @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +workspace { +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl new file mode 100644 index 00000000000..d980177be03 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file Administrator.cidl + * + * @author Don Busch + */ + +#ifndef ADMINISTRATOR_CIDL +#define ADMINISTRATOR_CIDL + +#include "Administrator.idl" + +composition session Administrator_Impl +{ + home executor AdministratorHome_Exec + { + implements AdministratorHome; + manages Administrator_Exec; + }; +}; + +#endif + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl new file mode 100644 index 00000000000..67bb016e157 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file Administrator.idl + * + * @author Don Busch + */ + +#ifndef ADMINISTRATOR_IDL +#define ADMINISTRATOR_IDL + +#include +#include "Runnable.idl" +#include "Publication.idl" + +component Administrator { + uses multiple Runnable runnables; + uses multiple Publication content; +}; + +home AdministratorHome manages Administrator {}; + +#endif + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc new file mode 100644 index 00000000000..2b869e58f51 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p Messenger Administrator" + +project(Messenger_Administrator_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=ADMINISTRATOR_STUB_Export \ + -Wb,stub_export_include=Administrator_stub_export.h \ + -Wb,skel_export_macro=ADMINISTRATOR_SVNT_Export \ + -Wb,skel_export_include=Administrator_svnt_export.h + + IDL_Files { + Administrator.idl + } +} + +project(Messenger_Administrator_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro ADMINISTRATOR_SVNT_Export \ + --svnt-export-include Administrator_svnt_export.h + idlflags += -Wb,export_macro=ADMINISTRATOR_EXEC_Export \ + -Wb,export_include=Administrator_exec_export.h \ + -SS + + CIDL_Files { + Administrator.cidl + } + + IDL_Files { + AdministratorE.idl + } +} + +project(Messenger_Administrator_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_Administrator_idl_gen Messenger_stub + libs += Messenger_stub + + sharedname = Administrator_stub + dynamicflags = ADMINISTRATOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + AdministratorC.cpp + } + + Header_Files { + AdministratorC.h + Administrator_stub_export.h + } + + Inline_Files { + AdministratorC.inl + } +} + +project(Messenger_Administrator_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_Administrator_cidl_gen Messenger_Administrator_stub + sharedname = Administrator_exec + libs += Administrator_stub Messenger_stub + + dynamicflags = ADMINISTRATOR_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + AdministratorEC.cpp + Administrator_exec_i.cpp + } + + Header_Files { + AdministratorEC.h + Administrator_exec_i.h + Administrator_exec_export.h + } + + Inline_Files { + AdministratorEC.inl + } +} + + +project(Messenger_Administrator_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_svnt Messenger_Administrator_exec + sharedname = Administrator_svnt + libs += Administrator_exec \ + Administrator_stub \ + Messenger_svnt \ + Messenger_stub + + dynamicflags = ADMINISTRATOR_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + AdministratorS.cpp + Administrator_svnt.cpp + } + + Header_Files { + AdministratorS.h + Administrator_svnt.h + Administrator_svnt_export.h + } + + Inline_Files { + AdministratorS.inl + } +} + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp new file mode 100644 index 00000000000..15378b35b78 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp @@ -0,0 +1,120 @@ +// $Id$ + +/** + * @file Administrator_Client.cpp + * + * Do NOT put this file in a project; it is included by + * Administrator_Client_IDL2.cpp and Administrator_Client_IDL3.cpp + * This file will not build on its own. + * + * @author Don Busch + */ + +#include "ace/Get_Opt.h" +#include + +const ACE_TCHAR* ior = ACE_TEXT ("file://Messenger.ior"); + +int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + + case '?': + default: + std::cerr << "usage: " << argv[0] << " -k " << std::endl; + return -1; + break; + } + return 0; +} + +int +svc( Runnable_ptr runnable, Publication_ptr publication ) +{ + enum SelectionType { START=1, STOP, CHANGE_PERIOD, CHANGE_TEXT, EXIT }; + + bool done = false; + do { + std::cout << "\nWhat do you want to do to the Messenger(s)?" << std::endl; + std::cout << START << ". Start" << std::endl; + std::cout << STOP << ". Stop" << std::endl; + std::cout << CHANGE_PERIOD << ". Change Publication Period" << std::endl; + std::cout << CHANGE_TEXT << ". Change Publication Text" << std::endl; + std::cout << EXIT << ". Exit" << std::endl; + + char selection_text[10]; + std::cout << "Please enter a selection: "; + std::cin.getline( selection_text, sizeof(selection_text) ); + int selection = ACE_OS::atoi(selection_text); + + switch (selection) { + case START: { + runnable->start(); + break; + } + case STOP: { + runnable->stop(); + break; + } + case CHANGE_PERIOD: { + char period[10]; + std::cout << "Please enter a new period in seconds: "; + std::cin.getline( period, sizeof( period ) ); + publication->period( ACE_OS::atoi(period) ); + break; + } + case CHANGE_TEXT: { + char buffer[1024]; + std::cout << "Please enter new text: "; + std::cin.getline( buffer, sizeof(buffer) ); + publication->text( buffer ); + break; + } + case EXIT: { + done = true; + break; + } + default: + std::cout << "Please enter a valid option" << std::endl; + } + } while ( !done ); + + return 0; +} + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + if (parse_args (argc, argv) != 0) { + return 1; + } + + try { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + // get Messenger object + CORBA::Object_var obj = orb->string_to_object(ior); + Messenger_var messenger = Messenger::_narrow (obj.in()); + + Runnable_var runnable = messenger->provide_control(); + Publication_var publication = messenger->provide_content (); + + svc( runnable.in(), publication.in() ); + + return 0; + } + catch(const CORBA::Exception& ex) { + std::cerr << "Caught CORBA::Exception: " << std::endl << ex << std::endl; + } + + return 1; +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp new file mode 100644 index 00000000000..399faa40389 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp @@ -0,0 +1,10 @@ +// $Id$ + +/** + * @file Administrator_Client_IDL2.cpp + * + * @author Don Busch + */ + +#include "idl2/Messenger_IDL2C.h" +#include "Administrator_Client.cpp" diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc new file mode 100644 index 00000000000..ad52beff2fe --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc @@ -0,0 +1,45 @@ +// $Id$ + +project(Administrator_Client_IDL2_Compile): taoidl3toidl2defaults { + // ensures that only idl3-to-idl2 processing is performed + custom_only = 1 + + idl3toidl2flags += -I. -o idl2 + + IDL3TOIDL2_Files { + gendir = idl2 + Runnable.idl + Publication.idl + Message.idl + History.idl + Administrator.idl + Messenger.idl + } +} + +project(Administrator_Client_IDL2): ccm_stub, valuetype { + after += Administrator_Client_IDL2_Compile + + exename = Administrator_Client_IDL2 + idlflags += -Sm -Iidl2 -o idl2 -SS + + IDL_Files { + gendir = idl2 + idl2/Runnable_IDL2.idl + idl2/Publication_IDL2.idl + idl2/Message_IDL2.idl + idl2/History_IDL2.idl + idl2/Administrator_IDL2.idl + idl2/Messenger_IDL2.idl + } + + Source_Files { + Administrator_Client_IDL2.cpp + idl2/Administrator_IDL2C.cpp + idl2/Messenger_IDL2C.cpp + idl2/Publication_IDL2C.cpp + idl2/Runnable_IDL2C.cpp + idl2/History_IDL2C.cpp + idl2/Message_IDL2C.cpp + } +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp new file mode 100644 index 00000000000..6e83b57165f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp @@ -0,0 +1,10 @@ +// $Id$ + +/** + * @file Administrator_Client_IDL3.cpp + * + * @author Don Busch + */ + +#include "MessengerC.h" +#include "Administrator_Client.cpp" diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc new file mode 100644 index 00000000000..5ac2cd88709 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc @@ -0,0 +1,29 @@ +// $Id$ + +// @file Administrator_Client_IDL3.mpc +// +// @author Don Busch + +project(Administrator_Client_IDL3): ccm_stub, valuetype { + after += Messenger_stub + libs += Messenger_stub + after += Administrator_Client_IDL2_Compile + + exename = Administrator_Client_IDL3 + + IDL_Files { + // IDL stubs are linked from the Messenger_stub library; + // this empty section prevents all of the IDL stub code from + // being linked into this executable as well + } + + Header_Files { + // this empty section prevents all of the header files + // being includes in this project + } + + Source_Files { + Administrator_Client_IDL3.cpp + } +} + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h new file mode 100644 index 00000000000..6cfb8385b61 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ADMINISTRATOR_EXEC +// ------------------------------ +#ifndef ADMINISTRATOR_EXEC_EXPORT_H +#define ADMINISTRATOR_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (ADMINISTRATOR_EXEC_HAS_DLL) +# define ADMINISTRATOR_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && ADMINISTRATOR_EXEC_HAS_DLL */ + +#if !defined (ADMINISTRATOR_EXEC_HAS_DLL) +# define ADMINISTRATOR_EXEC_HAS_DLL 1 +#endif /* ! ADMINISTRATOR_EXEC_HAS_DLL */ + +#if defined (ADMINISTRATOR_EXEC_HAS_DLL) && (ADMINISTRATOR_EXEC_HAS_DLL == 1) +# if defined (ADMINISTRATOR_EXEC_BUILD_DLL) +# define ADMINISTRATOR_EXEC_Export ACE_Proper_Export_Flag +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ADMINISTRATOR_EXEC_BUILD_DLL */ +# define ADMINISTRATOR_EXEC_Export ACE_Proper_Import_Flag +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ADMINISTRATOR_EXEC_BUILD_DLL */ +#else /* ADMINISTRATOR_EXEC_HAS_DLL == 1 */ +# define ADMINISTRATOR_EXEC_Export +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARATION(T) +# define ADMINISTRATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ADMINISTRATOR_EXEC_HAS_DLL == 1 */ + +// Set ADMINISTRATOR_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ADMINISTRATOR_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define ADMINISTRATOR_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ADMINISTRATOR_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ADMINISTRATOR_EXEC_NTRACE */ + +#if (ADMINISTRATOR_EXEC_NTRACE == 1) +# define ADMINISTRATOR_EXEC_TRACE(X) +#else /* (ADMINISTRATOR_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define ADMINISTRATOR_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (ADMINISTRATOR_EXEC_NTRACE == 1) */ + +#endif /* ADMINISTRATOR_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp new file mode 100644 index 00000000000..124f5b06149 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp @@ -0,0 +1,259 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Administrator_exec_i.h" +#include "ciao/CIAO_common.h" + +// MY CODE +#include +#include + +namespace CIDL_Administrator_Impl +{ + //================================================================== + // Component Executor Implementation Class: Administrator_exec_i + //================================================================== + + Administrator_exec_i::Administrator_exec_i (void) + { + } + + Administrator_exec_i::~Administrator_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + Administrator_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Administrator_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Administrator_exec_i::ccm_activate () + { + // Your code here. + + // MY CODE + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_activate\n" ))); + + // Activate the Task + this->activate(); + } + + void + Administrator_exec_i::ccm_passivate () + { + // Your code here. + + // MY CODE + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_passivate\n" ))); + } + + void + Administrator_exec_i::ccm_remove () + { + // Your code here. + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_remove\n"))); + } + + void configuration_complete (void) + { + ACE_DEBUG ((LM_INFO, ACE_TEXT("configuration_complete\n"))); + } + + // Overridden from ACE_Task_Base + int + Administrator_exec_i::svc() + { + enum SelectionType { START=1, STOP, CHANGE_PERIOD, CHANGE_TEXT,EXIT }; + + bool done = false; + do { + std::cout << "\nWhat do you want to do to the Messenger(s)?" << std::endl; + std::cout << START << ". Start" << std::endl; + std::cout << STOP << ". Stop" << std::endl; + std::cout << CHANGE_PERIOD << ". Change Publication Period" << std::endl; + std::cout << CHANGE_TEXT << ". Change Publication Text" << std::endl; + std::cout << EXIT << ". Exit" << std::endl; + + char selection_text[10]; + std::cout << "Please enter a selection: "; + std::cin.getline( selection_text, sizeof(selection_text) ); + int selection = ACE_OS::atoi(selection_text); + + switch (selection) { + case START: + startPublishing(); + break; + case STOP: + stopPublishing(); + break; + case CHANGE_PERIOD: + changePublicationPeriod(); + break; + case CHANGE_TEXT: + changePublicationText(); + break; + case EXIT: { + done = true; + break; + } + default: + std::cout << "Please enter a valid option" << std::endl; + } + } while ( !done ); + + return 0; + } + + void Administrator_exec_i::startPublishing() + { + // Get the attached Runnable facet(s) + ::Administrator::runnablesConnections_var connections = + this->context_->get_connections_runnables(); + + std::cout << "Starting Publication" << std::endl; + for ( unsigned int i = 0; i < connections->length(); ++i ) { + Runnable_var runnable = (*connections)[i].objref; + runnable->start(); + } + } + + void Administrator_exec_i::stopPublishing() + { + // Get the attached Runnable facet(s) + ::Administrator::runnablesConnections_var connections = + this->context_->get_connections_runnables(); + + std::cout << "Stopping Publication" << std::endl; + for ( unsigned int i = 0; i < connections->length(); ++i ) { + Runnable_var runnable = (*connections)[i].objref; + runnable->stop(); + } + } + + void Administrator_exec_i::changePublicationPeriod() + { + // Get the attached Publication facet(s) + ::Administrator::contentConnections_var contents = + this->context_->get_connections_content(); + + char period[10]; + std::cout << "Please enter a new period in seconds: "; + std::cin.getline( period, sizeof( period ) ); + for ( unsigned int i = 0; i < contents->length(); ++i ) { + Publication_var publication = (*contents)[i].objref; + publication->period( ACE_OS::atoi(period) ); + } + } + + void Administrator_exec_i::changePublicationText() + { + // Get the attached Publication facet(s) + ::Administrator::contentConnections_var contents = + this->context_->get_connections_content(); + + char buffer[1024]; + std::cout << "Please enter new text: "; + std::cin.getline( buffer, sizeof(buffer) ); + for ( unsigned int i = 0; i < contents->length(); ++i ) { + Publication_var publication = (*contents)[i].objref; + publication->text( buffer ); + } + } + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Administrator_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Administrator_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: AdministratorHome_exec_i + //================================================================== + + AdministratorHome_exec_i::AdministratorHome_exec_i (void) + { + } + + AdministratorHome_exec_i::~AdministratorHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + AdministratorHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Administrator_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_AdministratorHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + AdministratorHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h new file mode 100644 index 00000000000..405202583c7 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h @@ -0,0 +1,112 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_ADMINISTRATOR_EXEC_H +#define CIAO_ADMINISTRATOR_EXEC_H + +#include /**/ "ace/pre.h" + +#include "AdministratorEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Administrator_exec_export.h" +#include "tao/LocalObject.h" + +#include "ace/Task.h" + +namespace CIDL_Administrator_Impl +{ + class ADMINISTRATOR_EXEC_Export Administrator_exec_i + : public virtual Administrator_Exec, + public virtual ::CORBA::LocalObject, + public virtual ACE_Task_Base + { + public: + Administrator_exec_i (void); + virtual ~Administrator_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + // Overridden from ACE_Task_Base + int svc(); + + private: + + void startPublishing(); + void stopPublishing(); + void changePublicationPeriod(); + void changePublicationText(); + + ::CCM_Administrator_Context_var context_; + }; + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Administrator_Impl (void); + + class ADMINISTRATOR_EXEC_Export AdministratorHome_exec_i + : public virtual AdministratorHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + AdministratorHome_exec_i (void); + virtual ~AdministratorHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_AdministratorHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_ADMINISTRATOR_EXEC_H */ diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h new file mode 100644 index 00000000000..22b4ec62ce4 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ADMINISTRATOR_STUB +// ------------------------------ +#ifndef ADMINISTRATOR_STUB_EXPORT_H +#define ADMINISTRATOR_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (ADMINISTRATOR_STUB_HAS_DLL) +# define ADMINISTRATOR_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && ADMINISTRATOR_STUB_HAS_DLL */ + +#if !defined (ADMINISTRATOR_STUB_HAS_DLL) +# define ADMINISTRATOR_STUB_HAS_DLL 1 +#endif /* ! ADMINISTRATOR_STUB_HAS_DLL */ + +#if defined (ADMINISTRATOR_STUB_HAS_DLL) && (ADMINISTRATOR_STUB_HAS_DLL == 1) +# if defined (ADMINISTRATOR_STUB_BUILD_DLL) +# define ADMINISTRATOR_STUB_Export ACE_Proper_Export_Flag +# define ADMINISTRATOR_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ADMINISTRATOR_STUB_BUILD_DLL */ +# define ADMINISTRATOR_STUB_Export ACE_Proper_Import_Flag +# define ADMINISTRATOR_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ADMINISTRATOR_STUB_BUILD_DLL */ +#else /* ADMINISTRATOR_STUB_HAS_DLL == 1 */ +# define ADMINISTRATOR_STUB_Export +# define ADMINISTRATOR_STUB_SINGLETON_DECLARATION(T) +# define ADMINISTRATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ADMINISTRATOR_STUB_HAS_DLL == 1 */ + +// Set ADMINISTRATOR_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ADMINISTRATOR_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define ADMINISTRATOR_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ADMINISTRATOR_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ADMINISTRATOR_STUB_NTRACE */ + +#if (ADMINISTRATOR_STUB_NTRACE == 1) +# define ADMINISTRATOR_STUB_TRACE(X) +#else /* (ADMINISTRATOR_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define ADMINISTRATOR_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (ADMINISTRATOR_STUB_NTRACE == 1) */ + +#endif /* ADMINISTRATOR_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h new file mode 100644 index 00000000000..6c79eef8299 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ADMINISTRATOR_SVNT +// ------------------------------ +#ifndef ADMINISTRATOR_SVNT_EXPORT_H +#define ADMINISTRATOR_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (ADMINISTRATOR_SVNT_HAS_DLL) +# define ADMINISTRATOR_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && ADMINISTRATOR_SVNT_HAS_DLL */ + +#if !defined (ADMINISTRATOR_SVNT_HAS_DLL) +# define ADMINISTRATOR_SVNT_HAS_DLL 1 +#endif /* ! ADMINISTRATOR_SVNT_HAS_DLL */ + +#if defined (ADMINISTRATOR_SVNT_HAS_DLL) && (ADMINISTRATOR_SVNT_HAS_DLL == 1) +# if defined (ADMINISTRATOR_SVNT_BUILD_DLL) +# define ADMINISTRATOR_SVNT_Export ACE_Proper_Export_Flag +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ADMINISTRATOR_SVNT_BUILD_DLL */ +# define ADMINISTRATOR_SVNT_Export ACE_Proper_Import_Flag +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ADMINISTRATOR_SVNT_BUILD_DLL */ +#else /* ADMINISTRATOR_SVNT_HAS_DLL == 1 */ +# define ADMINISTRATOR_SVNT_Export +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARATION(T) +# define ADMINISTRATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ADMINISTRATOR_SVNT_HAS_DLL == 1 */ + +// Set ADMINISTRATOR_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ADMINISTRATOR_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define ADMINISTRATOR_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ADMINISTRATOR_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ADMINISTRATOR_SVNT_NTRACE */ + +#if (ADMINISTRATOR_SVNT_NTRACE == 1) +# define ADMINISTRATOR_SVNT_TRACE(X) +#else /* (ADMINISTRATOR_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define ADMINISTRATOR_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (ADMINISTRATOR_SVNT_NTRACE == 1) */ + +#endif /* ADMINISTRATOR_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/History.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/History.idl new file mode 100644 index 00000000000..c83cadf03bb --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/History.idl @@ -0,0 +1,19 @@ +// $Id$ + +/** + * @file History.idl + * + * @author Don Busch + */ + +#ifndef HISTORY_IDL +#define HISTORY_IDL + +#include "Message.idl" + +interface History { + Messages get_all(); + Message get_latest(); +}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp new file mode 100644 index 00000000000..be3e056f5cf --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp @@ -0,0 +1,96 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "History_exec_i.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_Messenger_Impl +{ + //================================================================== + // Facet Executor Implementation Class: History_exec_i + //================================================================== + + History_exec_i::History_exec_i (void) + { + } + + History_exec_i::~History_exec_i (void) + { + } + + // Operations from ::History + + ::Messages * + History_exec_i::get_all () + { + // Your code here. + + // MY CODE + ACE_Guard guard(this->lock_); + + ACE_DEBUG((LM_INFO, ACE_TEXT("History_i::get_all\n") )); + + // create a Messages sequence, set its length + ::Messages* retval = new ::Messages(); + retval->length( this->messages_.size() ); + + // iterate through the MessageList, copying messages into the return sequence + int i = 0; + for ( MessageList::iterator messageItr = this->messages_.begin(); + messageItr != this->messages_.end(); + ++messageItr ) { + + // because the MessageList contains Message_vars, reference counting + // upon assignment into the sequence is handled properly for us. + (*retval)[i++] = *messageItr; + } + return retval; + } + + ::Message * + History_exec_i::get_latest () + { + // Your code here. + + // MY CODE + ACE_Guard guard(this->lock_); + + ACE_DEBUG((LM_INFO, ACE_TEXT("History_i::get_latest\n") )); + + // just get the last message from the history. because the MessageList + // contains Message_vars, _var to _var assigmnent handles the reference + // counting properly for us. + ::Message_var retval = this->messages_.back(); + return retval._retn(); + } + + // MY CODE + void + History_exec_i::add( ::Message* message ) + { + ACE_Guard guard(lock_); + + // bump up the reference count; we don't own it. + // the _var in the STL list takes ownership of the "copy" + message->_add_ref(); + this->messages_.push_back( message ); + } +} + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h new file mode 100644 index 00000000000..afcdaf414f9 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h @@ -0,0 +1,72 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_HISTORY_EXEC_H +#define CIAO_HISTORY_EXEC_H + +#include /**/ "ace/pre.h" + +#include "MessengerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Messenger_exec_export.h" +#include "tao/LocalObject.h" + +// MY CODE +#include +#include "ace/Synch.h" + +namespace CIDL_Messenger_Impl +{ + class MESSENGER_EXEC_Export History_exec_i + : public virtual ::CCM_History, + public virtual ::CORBA::LocalObject + { + public: + History_exec_i (void); + virtual ~History_exec_i (void); + + // Operations from ::History + + virtual ::Messages * + get_all (); + + virtual ::Message * + get_latest (); + + // MY CODE + + void add( ::Message* message ); + + private: + ACE_Mutex lock_; + + typedef std::list< ::Message_var> MessageList; + MessageList messages_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_HISTORY_EXEC_H */ + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Message.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Message.idl new file mode 100644 index 00000000000..2e3aee687b0 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Message.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file Message.idl + * + * @author Don Busch + */ + +#ifndef MESSAGE_IDL +#define MESSAGE_IDL + +#include + +eventtype Message { + public string subject; + public string user; + public string text; +}; +typedef sequence Messages; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl new file mode 100644 index 00000000000..08559aafe0e --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file Messenger.cidl + * + * @author Don Busch + */ + +#ifndef MESSENGER_CIDL +#define MESSENGER_CIDL + +#include "Messenger.idl" + +composition session Messenger_Impl +{ + home executor MessengerHome_Exec + { + implements MessengerHome; + manages Messenger_Exec; + }; +}; + +#endif + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl new file mode 100644 index 00000000000..518dcfee754 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl @@ -0,0 +1,30 @@ +// $Id$ + +/** + * @file Messenger.idl + * + * @author Don Busch + */ + +#ifndef MESSENGER_IDL +#define MESSENGER_IDL + +#include +#include "Runnable.idl" +#include "Publication.idl" +#include "Message.idl" +#include "History.idl" + +component Messenger { + attribute string subject; + + provides Runnable control; + provides Publication content; + + publishes Message message_publisher; + provides History message_history; +}; + +home MessengerHome manages Messenger {}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc new file mode 100644 index 00000000000..caad4b867f7 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc @@ -0,0 +1,153 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl Messenger" + +project(Messenger_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export \ + -Wb,stub_export_include=Messenger_stub_export.h \ + -Wb,skel_export_macro=MESSENGER_SVNT_Export \ + -Wb,skel_export_include=Messenger_svnt_export.h + + IDL_Files { + Runnable.idl + Publication.idl + Message.idl + History.idl + Messenger.idl + } +} + +project(Messenger_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro MESSENGER_SVNT_Export \ + --svnt-export-include Messenger_svnt_export.h + idlflags += -Wb,export_macro=MESSENGER_EXEC_Export \ + -Wb,export_include=Messenger_exec_export.h \ + -SS + + CIDL_Files { + Messenger.cidl + } + + IDL_Files { + MessengerE.idl + } +} + +project(Messenger_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_idl_gen + libs += + + sharedname = Messenger_stub + dynamicflags = MESSENGER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + RunnableC.cpp + PublicationC.cpp + MessageC.cpp + HistoryC.cpp + MessengerC.cpp + } + + Header_Files { + RunnableC.h + PublicationC.h + MessageC.h + HistoryC.h + MessengerC.h + Messenger_stub_export.h + } + + Inline_Files { + RunnableC.inl + PublicationC.inl + MessageC.inl + HistoryC.inl + MessengerC.inl + } +} + +project(Messenger_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_cidl_gen Messenger_stub + sharedname = Messenger_exec + libs += Messenger_stub + + dynamicflags = MESSENGER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + MessengerEC.cpp + Messenger_exec_i.cpp + Publication_exec_i.cpp + History_exec_i.cpp + Runnable_exec_i.cpp + } + + Header_Files { + MessengerEC.h + Messenger_exec_i.h + Publication_exec_i.h + History_exec_i.h + Runnable_exec_i.h + Messenger_exec_export.h + } + + Inline_Files { + MessengerEC.inl + } +} + + +project(Messenger_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_exec + sharedname = Messenger_svnt + libs += Messenger_exec \ + Messenger_stub + + dynamicflags = MESSENGER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + RunnableS.cpp + PublicationS.cpp + MessageS.cpp + HistoryS.cpp + MessengerS.cpp + Messenger_svnt.cpp + } + + Header_Files { + RunnableS.h + PublicationS.h + MessageS.h + HistoryS.h + MessengerS.h + Messenger_svnt.h + Messenger_svnt_export.h + } + + Inline_Files { + RunnableS.inl + PublicationS.inl + MessageS.inl + HistoryS.inl + MessengerS.inl + } +} + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h new file mode 100644 index 00000000000..7aa56acc1c9 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl MESSENGER_EXEC +// ------------------------------ +#ifndef MESSENGER_EXEC_EXPORT_H +#define MESSENGER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (MESSENGER_EXEC_HAS_DLL) +# define MESSENGER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && MESSENGER_EXEC_HAS_DLL */ + +#if !defined (MESSENGER_EXEC_HAS_DLL) +# define MESSENGER_EXEC_HAS_DLL 1 +#endif /* ! MESSENGER_EXEC_HAS_DLL */ + +#if defined (MESSENGER_EXEC_HAS_DLL) && (MESSENGER_EXEC_HAS_DLL == 1) +# if defined (MESSENGER_EXEC_BUILD_DLL) +# define MESSENGER_EXEC_Export ACE_Proper_Export_Flag +# define MESSENGER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* MESSENGER_EXEC_BUILD_DLL */ +# define MESSENGER_EXEC_Export ACE_Proper_Import_Flag +# define MESSENGER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* MESSENGER_EXEC_BUILD_DLL */ +#else /* MESSENGER_EXEC_HAS_DLL == 1 */ +# define MESSENGER_EXEC_Export +# define MESSENGER_EXEC_SINGLETON_DECLARATION(T) +# define MESSENGER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* MESSENGER_EXEC_HAS_DLL == 1 */ + +// Set MESSENGER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (MESSENGER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define MESSENGER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define MESSENGER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !MESSENGER_EXEC_NTRACE */ + +#if (MESSENGER_EXEC_NTRACE == 1) +# define MESSENGER_EXEC_TRACE(X) +#else /* (MESSENGER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define MESSENGER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (MESSENGER_EXEC_NTRACE == 1) */ + +#endif /* MESSENGER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp new file mode 100644 index 00000000000..6a651b61fa8 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp @@ -0,0 +1,254 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Messenger_exec_i.h" +#include "ciao/CIAO_common.h" + +// MY CODE +#include "ace/OS.h" +#include "History_exec_i.h" +#include "Runnable_exec_i.h" +#include "Publication_exec_i.h" + +namespace CIDL_Messenger_Impl +{ + //================================================================== + // Component Executor Implementation Class: Messenger_exec_i + //================================================================== + + Messenger_exec_i::Messenger_exec_i () + : subject_( "Test Subject" ), + user_( "ciao_user" ) + { + this->control_ = new Runnable_exec_i(); + this->history_ = new History_exec_i(); + this->content_ = new Publication_exec_i( + "The quick brown fox jumped over the lazy dog", + 2 ); + } + + Messenger_exec_i::~Messenger_exec_i (void) + { + this->control_->_remove_ref(); + this->history_->_remove_ref(); + this->content_->_remove_ref(); + } + + // MY CODE + int Messenger_exec_i::svc() { + + ACE_DEBUG((LM_INFO, ACE_TEXT("svc()\n"))); + + while (1) + { + ACE_OS::sleep( this->content_->period() ); + + // get the run_lock from the Runnable executor; we have an + // agreement with the Runnable executor that we must posess the + // run_lock to publish + ACE_Guard guard( this->control_->get_run_lock() ); + + // create a message to publish + ::Message_var msg = new ::OBV_Message(); + msg->subject( this->subject() ); + msg->text( this->content_->text() ); + msg->user( CORBA::string_dup( this->user_.c_str() ) ); + + // add the message to the message history + this->history_->add( msg.in() ); + + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::svc: publishing message\n") )); + + // publish to all interested consumers + this->context_->push_message_publisher( msg.in() ); + + ACE_DEBUG((LM_INFO, + ACE_TEXT("Published Message on subject %s\n User %s\n Text %s\n"), + msg->subject(), + msg->user(), + msg->text() )); + } + + ACE_DEBUG((LM_INFO, ACE_TEXT("svc(): Gracefully stopping publication\n"))); + return 0; + } + + // Supported or inherited operations. + + // Attribute operations. + + char* + Messenger_exec_i::subject () + { + return CORBA::string_dup( this->subject_.c_str() ); + } + + void + Messenger_exec_i::subject ( const char* subject) + { + this->subject_ = CORBA::string_dup( subject ); + } + + // Port operations. + + ::CCM_Runnable_ptr + Messenger_exec_i::get_control () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->control_->_add_ref(); + return this->control_; + } + + ::CCM_Publication_ptr + Messenger_exec_i::get_content () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->content_->_add_ref(); + return this->content_; + } + + ::CCM_History_ptr + Messenger_exec_i::get_message_history () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->history_->_add_ref(); + return this->history_; + } + + // Operations from Components::SessionComponent + + void + Messenger_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Messenger_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Messenger_exec_i::configuration_complete () + { + /* Your code here. */ + } + + void + Messenger_exec_i::ccm_activate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_activate\n"))); + this->activate(); + } + + void + Messenger_exec_i::ccm_passivate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_passivate\n"))); + } + + void + Messenger_exec_i::ccm_remove () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_remove\n"))); + } + + + extern "C" MESSENGER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Messenger_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Messenger_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: MessengerHome_exec_i + //================================================================== + + MessengerHome_exec_i::MessengerHome_exec_i (void) + { + } + + MessengerHome_exec_i::~MessengerHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + MessengerHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Messenger_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_MessengerHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + MessengerHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h new file mode 100644 index 00000000000..0cf2ffb8411 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h @@ -0,0 +1,136 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_MESSENGER_EXEC_H +#define CIAO_MESSENGER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "MessengerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Messenger_exec_export.h" +#include "tao/LocalObject.h" + +// MY CODE +#include +#include "ace/Task.h" + +namespace CIDL_Messenger_Impl +{ + class Runnable_exec_i; + class Publication_exec_i; + class History_exec_i; + + class MESSENGER_EXEC_Export Messenger_exec_i + : public virtual Messenger_Exec, + public virtual ::CORBA::LocalObject, + public virtual ACE_Task_Base + { + public: + Messenger_exec_i (void); + virtual ~Messenger_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + virtual char * + subject (); + + virtual void + subject (const char * subject); + + // Port operations. + + virtual ::CCM_Runnable_ptr + get_control (); + + virtual ::CCM_Publication_ptr + get_content (); + + virtual ::CCM_History_ptr + get_message_history (); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + // MY CODE + virtual int svc(); + + private: + ::CCM_Messenger_Context_var context_; + + // MY CODE + Runnable_exec_i* control_; + Publication_exec_i* content_; + History_exec_i* history_; + + std::string subject_; + const std::string user_; + }; + + extern "C" MESSENGER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Messenger_Impl (void); + + class MESSENGER_EXEC_Export MessengerHome_exec_i + : public virtual MessengerHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + MessengerHome_exec_i (void); + virtual ~MessengerHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_MessengerHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_MESSENGER_EXEC_H */ + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h new file mode 100644 index 00000000000..7e4502b434f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl MESSENGER_STUB +// ------------------------------ +#ifndef MESSENGER_STUB_EXPORT_H +#define MESSENGER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (MESSENGER_STUB_HAS_DLL) +# define MESSENGER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && MESSENGER_STUB_HAS_DLL */ + +#if !defined (MESSENGER_STUB_HAS_DLL) +# define MESSENGER_STUB_HAS_DLL 1 +#endif /* ! MESSENGER_STUB_HAS_DLL */ + +#if defined (MESSENGER_STUB_HAS_DLL) && (MESSENGER_STUB_HAS_DLL == 1) +# if defined (MESSENGER_STUB_BUILD_DLL) +# define MESSENGER_STUB_Export ACE_Proper_Export_Flag +# define MESSENGER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* MESSENGER_STUB_BUILD_DLL */ +# define MESSENGER_STUB_Export ACE_Proper_Import_Flag +# define MESSENGER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* MESSENGER_STUB_BUILD_DLL */ +#else /* MESSENGER_STUB_HAS_DLL == 1 */ +# define MESSENGER_STUB_Export +# define MESSENGER_STUB_SINGLETON_DECLARATION(T) +# define MESSENGER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* MESSENGER_STUB_HAS_DLL == 1 */ + +// Set MESSENGER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (MESSENGER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define MESSENGER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define MESSENGER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !MESSENGER_STUB_NTRACE */ + +#if (MESSENGER_STUB_NTRACE == 1) +# define MESSENGER_STUB_TRACE(X) +#else /* (MESSENGER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define MESSENGER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (MESSENGER_STUB_NTRACE == 1) */ + +#endif /* MESSENGER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h new file mode 100644 index 00000000000..088b1c1ccbc --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl MESSENGER_SVNT +// ------------------------------ +#ifndef MESSENGER_SVNT_EXPORT_H +#define MESSENGER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (MESSENGER_SVNT_HAS_DLL) +# define MESSENGER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && MESSENGER_SVNT_HAS_DLL */ + +#if !defined (MESSENGER_SVNT_HAS_DLL) +# define MESSENGER_SVNT_HAS_DLL 1 +#endif /* ! MESSENGER_SVNT_HAS_DLL */ + +#if defined (MESSENGER_SVNT_HAS_DLL) && (MESSENGER_SVNT_HAS_DLL == 1) +# if defined (MESSENGER_SVNT_BUILD_DLL) +# define MESSENGER_SVNT_Export ACE_Proper_Export_Flag +# define MESSENGER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* MESSENGER_SVNT_BUILD_DLL */ +# define MESSENGER_SVNT_Export ACE_Proper_Import_Flag +# define MESSENGER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define MESSENGER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* MESSENGER_SVNT_BUILD_DLL */ +#else /* MESSENGER_SVNT_HAS_DLL == 1 */ +# define MESSENGER_SVNT_Export +# define MESSENGER_SVNT_SINGLETON_DECLARATION(T) +# define MESSENGER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* MESSENGER_SVNT_HAS_DLL == 1 */ + +// Set MESSENGER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (MESSENGER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define MESSENGER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define MESSENGER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !MESSENGER_SVNT_NTRACE */ + +#if (MESSENGER_SVNT_NTRACE == 1) +# define MESSENGER_SVNT_TRACE(X) +#else /* (MESSENGER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define MESSENGER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (MESSENGER_SVNT_NTRACE == 1) */ + +#endif /* MESSENGER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Publication.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication.idl new file mode 100644 index 00000000000..43cf29228cc --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication.idl @@ -0,0 +1,17 @@ +// $Id$ + +/** + * @file Publication.idl + * + * @author Don Busch + */ + +#ifndef PUBLICATION_IDL +#define PUBLICATION_IDL + +interface Publication { + attribute string text; + attribute unsigned short period; +}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp new file mode 100644 index 00000000000..c232cb9ac77 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp @@ -0,0 +1,85 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Publication_exec_i.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_Messenger_Impl +{ + //================================================================== + // Facet Executor Implementation Class: Publication_exec_i + //================================================================== + + Publication_exec_i::Publication_exec_i ( + const char* text, + CORBA::UShort period ) + : text_( text ), + period_( period) + { + } + + Publication_exec_i::~Publication_exec_i (void) + { + } + + // Operations from ::Publication + + char* + Publication_exec_i::text () + { + ACE_Guard guard(this->lock_); + + return CORBA::string_dup( this->text_.c_str() ); + } + + void + Publication_exec_i::text ( + const char* text) + { + ACE_Guard guard(this->lock_); + + this->text_ = text; + ACE_DEBUG((LM_INFO, ACE_TEXT("publication text changed to %s\n"), text )); + } + + CORBA::UShort + Publication_exec_i::period () + { + ACE_Guard guard(this->lock_); + + return this->period_; + } + + void + Publication_exec_i::period ( + CORBA::UShort period) + { + ACE_Guard guard( this->lock_ ); + + if ( period > 0 ) { + this->period_ = period; + ACE_DEBUG((LM_INFO, ACE_TEXT("publication period changed to %d seconds\n"), period )); + } else { + ACE_DEBUG((LM_INFO, ACE_TEXT("ignoring a non-positive period of %d\n"), period )); + } + } + +} + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h new file mode 100644 index 00000000000..b0f0cad8975 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h @@ -0,0 +1,75 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_PUBLICATION_EXEC_H +#define CIAO_PUBLICATION_EXEC_H + +#include /**/ "ace/pre.h" + +#include "MessengerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Messenger_exec_export.h" +#include "tao/LocalObject.h" + +// MY CODE +#include +#include "ace/Synch.h" + +namespace CIDL_Messenger_Impl +{ + class MESSENGER_EXEC_Export Publication_exec_i + : public virtual ::CCM_Publication, + public virtual ::CORBA::LocalObject + { + public: + Publication_exec_i ( const char* text, + CORBA::UShort period ); + virtual ~Publication_exec_i (void); + + // Operations from ::Publication + + virtual char* + text (); + + virtual void + text ( const char* text); + + virtual CORBA::UShort + period (); + + virtual void + period ( CORBA::UShort period); + + private: + std::string text_; + CORBA::UShort period_; + + ACE_Mutex lock_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_PUBLICATION_EXEC_H */ + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl new file mode 100644 index 00000000000..1deaf19ed2d --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Receiver.cidl + * + * @author Don Busch + */ + +#ifndef RECEIVER_CIDL +#define RECEIVER_CIDL + +#include "Receiver.idl" + +composition session Receiver_Impl +{ + home executor ReceiverHome_Exec + { + implements ReceiverHome; + manages Receiver_Exec; + }; +}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl new file mode 100644 index 00000000000..2d22feceb70 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Receiver.idl + * + * @author Don Busch + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include +#include "Message.idl" +#include "History.idl" + +component Receiver { + consumes Message message_consumer; + uses History message_history; +}; + +home ReceiverHome manages Receiver {}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc new file mode 100644 index 00000000000..d58c54029cc --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p Messenger Receiver" + +project(Messenger_Receiver_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h + + IDL_Files { + Receiver.idl + } +} + +project(Messenger_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro RECEIVER_SVNT_Export \ + --svnt-export-include Receiver_svnt_export.h + idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ + -Wb,export_include=Receiver_exec_export.h \ + -SS + + CIDL_Files { + Receiver.cidl + } + + IDL_Files { + ReceiverE.idl + } +} + +project(Messenger_Receiver_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_Receiver_idl_gen Messenger_stub + libs += Messenger_stub + + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReceiverC.cpp + } + + Header_Files { + ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + ReceiverC.inl + } +} + +project(Messenger_Receiver_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_Receiver_cidl_gen Messenger_Receiver_stub + sharedname = Receiver_exec + libs += Receiver_stub Messenger_stub + + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReceiverEC.cpp + Receiver_exec_i.cpp + } + + Header_Files { + ReceiverEC.h + Receiver_exec_i.h + Receiver_exec_export.h + } + + Inline_Files { + ReceiverEC.inl + } +} + + +project(Messenger_Receiver_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_svnt Messenger_Receiver_exec + sharedname = Receiver_svnt + libs += Receiver_exec \ + Receiver_stub \ + Messenger_svnt \ + Messenger_stub + + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + ReceiverS.cpp + Receiver_svnt.cpp + } + + Header_Files { + ReceiverS.h + Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + ReceiverS.inl + } +} + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h new file mode 100644 index 00000000000..9ae7b9ce799 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RECEIVER_EXEC +// ------------------------------ +#ifndef RECEIVER_EXEC_EXPORT_H +#define RECEIVER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (RECEIVER_EXEC_HAS_DLL) +# define RECEIVER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && RECEIVER_EXEC_HAS_DLL */ + +#if !defined (RECEIVER_EXEC_HAS_DLL) +# define RECEIVER_EXEC_HAS_DLL 1 +#endif /* ! RECEIVER_EXEC_HAS_DLL */ + +#if defined (RECEIVER_EXEC_HAS_DLL) && (RECEIVER_EXEC_HAS_DLL == 1) +# if defined (RECEIVER_EXEC_BUILD_DLL) +# define RECEIVER_EXEC_Export ACE_Proper_Export_Flag +# define RECEIVER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RECEIVER_EXEC_BUILD_DLL */ +# define RECEIVER_EXEC_Export ACE_Proper_Import_Flag +# define RECEIVER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RECEIVER_EXEC_BUILD_DLL */ +#else /* RECEIVER_EXEC_HAS_DLL == 1 */ +# define RECEIVER_EXEC_Export +# define RECEIVER_EXEC_SINGLETON_DECLARATION(T) +# define RECEIVER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RECEIVER_EXEC_HAS_DLL == 1 */ + +// Set RECEIVER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RECEIVER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define RECEIVER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RECEIVER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RECEIVER_EXEC_NTRACE */ + +#if (RECEIVER_EXEC_NTRACE == 1) +# define RECEIVER_EXEC_TRACE(X) +#else /* (RECEIVER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define RECEIVER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (RECEIVER_EXEC_NTRACE == 1) */ + +#endif /* RECEIVER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp new file mode 100644 index 00000000000..84b452874c6 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp @@ -0,0 +1,178 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Receiver_exec_i.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_Receiver_Impl +{ + //================================================================== + // Component Executor Implementation Class: Receiver_exec_i + //================================================================== + + Receiver_exec_i::Receiver_exec_i (void) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + void + Receiver_exec_i::push_message_consumer ( + ::Message * ev) + { + /* Your code here. */ + + // MY CODE + + CORBA::String_var subject = ev->subject(); + CORBA::String_var user = ev->user(); + CORBA::String_var text = ev->text(); + + ACE_DEBUG((LM_INFO, + ACE_TEXT("Received Message:\n Subject: %s\n User: %s\n Text: %s\n"), + subject.in(), + user.in(), + text.in() )); + + // Use the history to (inefficiently) get the total number of messages + // published on this item so far + ::History_var history = + this->context_->get_connection_message_history(); + ::Messages_var messages = history->get_all(); + ACE_DEBUG((LM_INFO, + ACE_TEXT(" Subject \"%s\" has published %d messages so far\n"), + subject.in(), + messages->length() )); + } + + // Operations from Components::SessionComponent + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Receiver_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::configuration_complete\n"))); + } + + void + Receiver_exec_i::ccm_activate () + { + // Your code here. + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_activate\n"))); + } + + void + Receiver_exec_i::ccm_passivate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_passivate\n"))); + } + + void + Receiver_exec_i::ccm_remove () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_remove\n"))); + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Receiver_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: ReceiverHome_exec_i + //================================================================== + + ReceiverHome_exec_i::ReceiverHome_exec_i (void) + { + } + + ReceiverHome_exec_i::~ReceiverHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + ReceiverHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Receiver_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_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/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h new file mode 100644 index 00000000000..e2df7a70750 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h @@ -0,0 +1,105 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_RECEIVER_EXEC_H +#define CIAO_RECEIVER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "ReceiverEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Receiver_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_Receiver_Impl +{ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual void + push_message_consumer ( + ::Message *ev); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::CCM_Receiver_Context_var context_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Receiver_Impl (void); + + class RECEIVER_EXEC_Export ReceiverHome_exec_i + : public virtual ReceiverHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + ReceiverHome_exec_i (void); + virtual ~ReceiverHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_ReceiverHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_RECEIVER_EXEC_H */ + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h new file mode 100644 index 00000000000..ad411db973f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RECEIVER_STUB +// ------------------------------ +#ifndef RECEIVER_STUB_EXPORT_H +#define RECEIVER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (RECEIVER_STUB_HAS_DLL) +# define RECEIVER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && RECEIVER_STUB_HAS_DLL */ + +#if !defined (RECEIVER_STUB_HAS_DLL) +# define RECEIVER_STUB_HAS_DLL 1 +#endif /* ! RECEIVER_STUB_HAS_DLL */ + +#if defined (RECEIVER_STUB_HAS_DLL) && (RECEIVER_STUB_HAS_DLL == 1) +# if defined (RECEIVER_STUB_BUILD_DLL) +# define RECEIVER_STUB_Export ACE_Proper_Export_Flag +# define RECEIVER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RECEIVER_STUB_BUILD_DLL */ +# define RECEIVER_STUB_Export ACE_Proper_Import_Flag +# define RECEIVER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RECEIVER_STUB_BUILD_DLL */ +#else /* RECEIVER_STUB_HAS_DLL == 1 */ +# define RECEIVER_STUB_Export +# define RECEIVER_STUB_SINGLETON_DECLARATION(T) +# define RECEIVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RECEIVER_STUB_HAS_DLL == 1 */ + +// Set RECEIVER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RECEIVER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define RECEIVER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RECEIVER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RECEIVER_STUB_NTRACE */ + +#if (RECEIVER_STUB_NTRACE == 1) +# define RECEIVER_STUB_TRACE(X) +#else /* (RECEIVER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define RECEIVER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (RECEIVER_STUB_NTRACE == 1) */ + +#endif /* RECEIVER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h new file mode 100644 index 00000000000..51ed45dc299 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RECEIVER_SVNT +// ------------------------------ +#ifndef RECEIVER_SVNT_EXPORT_H +#define RECEIVER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (RECEIVER_SVNT_HAS_DLL) +# define RECEIVER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && RECEIVER_SVNT_HAS_DLL */ + +#if !defined (RECEIVER_SVNT_HAS_DLL) +# define RECEIVER_SVNT_HAS_DLL 1 +#endif /* ! RECEIVER_SVNT_HAS_DLL */ + +#if defined (RECEIVER_SVNT_HAS_DLL) && (RECEIVER_SVNT_HAS_DLL == 1) +# if defined (RECEIVER_SVNT_BUILD_DLL) +# define RECEIVER_SVNT_Export ACE_Proper_Export_Flag +# define RECEIVER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RECEIVER_SVNT_BUILD_DLL */ +# define RECEIVER_SVNT_Export ACE_Proper_Import_Flag +# define RECEIVER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RECEIVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RECEIVER_SVNT_BUILD_DLL */ +#else /* RECEIVER_SVNT_HAS_DLL == 1 */ +# define RECEIVER_SVNT_Export +# define RECEIVER_SVNT_SINGLETON_DECLARATION(T) +# define RECEIVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RECEIVER_SVNT_HAS_DLL == 1 */ + +// Set RECEIVER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RECEIVER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define RECEIVER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RECEIVER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RECEIVER_SVNT_NTRACE */ + +#if (RECEIVER_SVNT_NTRACE == 1) +# define RECEIVER_SVNT_TRACE(X) +#else /* (RECEIVER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define RECEIVER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (RECEIVER_SVNT_NTRACE == 1) */ + +#endif /* RECEIVER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl new file mode 100644 index 00000000000..61515b7c17a --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl @@ -0,0 +1,17 @@ +// $Id$ + +/** + * @file Runnable.idl + * + * @author Don Busch + */ + +#ifndef RUNNABLE_IDL +#define RUNNABLE_IDL + +interface Runnable { + void start(); + void stop(); +}; + +#endif diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp new file mode 100644 index 00000000000..a98cc736006 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp @@ -0,0 +1,61 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Runnable_exec_i.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_Messenger_Impl +{ + //================================================================== + // Facet Executor Implementation Class: Runnable_exec_i + //================================================================== + + Runnable_exec_i::Runnable_exec_i () + { + // initially in "stopped" state + this->stop(); + } + + Runnable_exec_i::~Runnable_exec_i (void) + { + // don't own anything + } + + // Operations from ::Runnable + + void + Runnable_exec_i::start () + { + this->run_lock_.release(); + } + + void + Runnable_exec_i::stop () + { + this->run_lock_.acquire(); + } + + ACE_Mutex& + Runnable_exec_i::get_run_lock () + { + return this->run_lock_; + } +} + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h new file mode 100644 index 00000000000..7bde31dd299 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h @@ -0,0 +1,68 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_RUNNABLE_EXEC_H +#define CIAO_RUNNABLE_EXEC_H + +#include /**/ "ace/pre.h" + +#include "MessengerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Messenger_exec_export.h" +#include "tao/LocalObject.h" + +// MY CODE +#include "ace/Synch.h" + +namespace CIDL_Messenger_Impl +{ + class MESSENGER_EXEC_Export Runnable_exec_i + : public virtual ::CCM_Runnable, + public virtual ::CORBA::LocalObject + { + public: + Runnable_exec_i (); + virtual ~Runnable_exec_i (void); + + // Operations from ::Runnable + + virtual void + start (); + + virtual void + stop (); + + // MY CODE + + ACE_Mutex& get_run_lock(); + + private: + ACE_Mutex run_lock_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_RUNNABLE_EXEC_H */ + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc new file mode 100644 index 00000000000..caae6351bbc --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc @@ -0,0 +1,18 @@ +// -*- MPC -*- +// $Id$ + +project(Messenger_StaticDAnCE) { + exename = Messenger_StaticDAnCE + requires += dummy_label + + libs += Receiver_stub Administrator_stub Messenger_stub + libs += Receiver_svnt Administrator_svnt Messenger_svnt + libs += Receiver_exec Administrator_exec Messenger_exec + libpaths += .. + + after += Receiver_exec Administrator_exec Messenger_exec + + Source_Files { + StaticDAnCEApp.cpp + } +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt new file mode 100644 index 00000000000..71cfbcf947f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt @@ -0,0 +1,35 @@ +// $Id$ + +plan.h +------- +generated by running +$CIAO_ROOT/DAnCE/StaticConfiguration/StaticDAnCEParser -p + ../descriptors/Application-flattened.cdp + +Messenger_StaticDAnCE.mpc +------------------------- +started with a copy of StaticDAnCEApp.mpc.tmpl from + $CIAO_ROOT/DAnCE/StaticConfiguration +changed project name and exe name +replaces example libs with libs built in the .. directory +added the after += line + +StaticDAnCEApp.cpp +------------------ +copied from StaticDAnCEApp.cpp.tmpl in $CIAO_ROOT/DAnCE/StaticConfiguration + +run_test.pl +----------- +a modified copy of the ../descriptors/run_test.pl script that uses the static +application in place of the NodeManager to run the Messenger_Node (port 44000) + +To run the test on the target, start the Messenger_StaticDAnCE executable +(with -ORBEndpoint iiop://:44000) first on the target. +Then comment out the spawning of process NA4 in the run_test.pl script. +Also modify the final line of ../descriptors/ApplicationNodeMap.dat to +replace host with the hostname or IP address of the target system. + +Known issues: +- During shutodwn the Execution_Manager will print out some exceptions when +it tries to communicate with the Messenger_StaticDAnCE process that has +already terminated. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp new file mode 100644 index 00000000000..daf16e8cbba --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp @@ -0,0 +1,102 @@ +// $Id$ + +#include "Container_Base.h" +#include "NodeManager/NodeManager_Impl.h" +#include "ace/OS_NS_stdio.h" +#include "ace/streams.h" +#include "ace/Get_Opt.h" +#include "tao/IORTable/IORTable.h" +#include "tao/CDR.h" +#include "plan.h" + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + // Initialize the ORB so that CORBA::Any will work + // + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv); + try + { + // Get reference to Root POA. + CORBA::Object_var obj + = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var poa + = PortableServer::POA::_narrow (obj.in ()); + + // Activate POA manager + PortableServer::POAManager_var mgr + = poa->the_POAManager (); + + mgr->activate (); + + int homes_table_size = + sizeof (homes_table)/sizeof(HomeAttributes); + + CIAO::HOMECREATOR_FUNCPTR_MAP home_creator_fptr_map; + CIAO::HOMESERVANTCREATOR_FUNCPTR_MAP homesvnt_creator_fptr_map; + CIAO::Static_Config_EntryPoints_Maps static_config_entrypoints_maps; + static_config_entrypoints_maps.home_creator_funcptr_map_ = &home_creator_fptr_map; + static_config_entrypoints_maps.home_servant_creator_funcptr_map_ = &homesvnt_creator_fptr_map; + + int i=0; + for (i=0; iinit (); + + CORBA::Object_var table_object = + orb->resolve_initial_references ("IORTable"); + + IORTable::Table_var adapter = + IORTable::Table::_narrow (table_object.in ()); + + if (CORBA::is_nil (adapter.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Nil IORTable\n"), -1); + + CIAO::NodeManagerDaemon_var manager = + static_node_manager_impl->_this (); + + CORBA::String_var str = + orb->object_to_string (manager.in ()); + + adapter->bind ("NodeManager", + str.in ()); + + // Run the main event loop for the ORB. + orb->run (); + + poa->destroy (1, 1); + + orb->destroy (); + } + catch (CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught CORBA Exception: "); + return -1; + } + + return 0; +} diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h new file mode 100644 index 00000000000..a5732221e75 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h @@ -0,0 +1,47 @@ +// $Id$ + +#include "Session_Container.h" + +extern "C" ::Components::HomeExecutorBase_ptr create_MessengerHome_Impl (void); +extern "C" ::PortableServer::Servant create_MessengerHome_Servant + (::Components::HomeExecutorBase_ptr p, + ::CIAO::Session_Container *c, + const char* + ); +extern "C" ::Components::HomeExecutorBase_ptr create_ReceiverHome_Impl (void); +extern "C" ::PortableServer::Servant create_ReceiverHome_Servant + (::Components::HomeExecutorBase_ptr p, + ::CIAO::Session_Container *c, + const char* + ); +extern "C" ::Components::HomeExecutorBase_ptr create_ReceiverHome_Impl (void); +extern "C" ::PortableServer::Servant create_ReceiverHome_Servant + (::Components::HomeExecutorBase_ptr p, + ::CIAO::Session_Container *c, + const char* + ); +extern "C" ::Components::HomeExecutorBase_ptr create_AdministratorHome_Impl (void); +extern "C" ::PortableServer::Servant create_AdministratorHome_Servant + (::Components::HomeExecutorBase_ptr p, + ::CIAO::Session_Container *c, + const char* + ); +struct HomeAttributes +{ + char const * component_instance_name_; + /// Specify the entrypoint to component executor DLL. + char const * executor_entrypt_; + ::CIAO::HomeFactory executor_fptr_; + /// Specify the entrypoint to component servant DLL. + char const * servant_entrypt_; + ::CIAO::ServantFactory servant_fptr_; +}; +/// Homes +HomeAttributes homes_table[]= +{ + {"Messenger_Instance", "create_MessengerHome_Impl", create_MessengerHome_Impl, "create_MessengerHome_Servant", create_MessengerHome_Servant}, + {"First_Receiver_Instance", "create_ReceiverHome_Impl", create_ReceiverHome_Impl, "create_ReceiverHome_Servant", create_ReceiverHome_Servant}, + {"Second_Receiver_Instance", "create_ReceiverHome_Impl", create_ReceiverHome_Impl, "create_ReceiverHome_Servant", create_ReceiverHome_Servant}, + {"Administrator_Instance", "create_AdministratorHome_Impl", create_AdministratorHome_Impl, "create_AdministratorHome_Servant", create_AdministratorHome_Servant} +}; + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl new file mode 100644 index 00000000000..825faac5456 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl @@ -0,0 +1,110 @@ +# $Id$ + +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +use Env (ACE_ROOT); +use lib "$ACE_ROOT/bin"; +use PerlACE::Run_Test; + +$emior= PerlACE::LocalFile ("em.ior"); +unlink $emior; +$plior= PerlACE::LocalFile ("pl.ior"); +unlink $plior; + +if (defined $ENV{'CIAO_ROOT'}) { + $CIAO_ROOT = $ENV{'CIAO_ROOT'}; +} +else { + $CIAO_ROOT = $ACE_ROOT/TAO/CIAO; +} + +$NA = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); +$NA_cmd = $NA->Executable (); + +$NA1 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:11000 -s $NA_cmd"); + +$NA2 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:22000 -s $NA_cmd"); + +$NA3 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:33000 -s $NA_cmd"); + +$NA4 = new PerlACE::Process ("Messenger_StaticDAnCE", + "-ORBEndpoint iiop://:44000"); + +# Each Node Manager lauches a Node Application process. +open(STDIN, "<../descriptors/admin.dat"); +$Ret1 = $NA1->Spawn (); +if($Ret1 == -1) { + print STDERR "ERROR: Administrator returned <$Ret1>\n" +} + +$Ret2 = $NA2->Spawn (); +if($Ret2 == -1) { + print STDERR "ERROR: Receiver 1 returned <$Ret2>\n" +} + +$Ret3 = $NA3->Spawn (); +if($Ret3 == -1) { + print STDERR "ERROR: Receiver 2 returned <$Ret3>\n" +} + +$Ret4 = $NA4->Spawn (); +if($Ret4 == -1) { + print STDERR "ERROR: Messenger returned <$Ret4>\n" +} + +#Start an Execution Manager +$EM = new PerlACE::Process ("$CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager", "-o $emior -i ../descriptors/ApplicationNodeMap.dat"); + +$Ret5 = $EM->Spawn (); +if($Ret5 == -1) { + print STDERR "ERROR: Execution Manager returned <$Ret5>\n" +} + +if (PerlACE::waitforfile_timed ($emior, 5) == -1) { + print STDERR "ERROR: cannot find file <$emior>\n"; + $EM->Kill(); + unlink $emior; + exit 1; +} + +sleep(5); +#Start the plan laucnher +$EX = new PerlACE::Process ("$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher", + "-p ../descriptors/Application-flattened.cdp ". + "-k file://$emior -o $plior"); + +#Stop the plan launcher +$EX2 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher", + "-k file://$emior -i file://$plior"); + +$Ret6 = $EX->Spawn (); +if($Ret6 == -1) { + print STDERR "ERROR: plan launcher returned <$Ret6>\n" +} + +sleep(10); + +$Ret7 = $EX2->Spawn (); +if($Ret7 == -1) { + print STDERR "ERROR: plan launcher (shutdown) returned <$Ret7>\n" +} + +sleep(5); +$EX2->Kill(); +$EX->Kill(); +$EM->Kill(); + +$NA1->Kill(); +$NA2->Kill(); +$NA3->Kill(); +$NA4->Kill(); + +unlink $emior; +unlink $plior; + +exit 0; diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd new file mode 100644 index 00000000000..23ba49bb84c --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd @@ -0,0 +1,47 @@ + + + + IDL:Administrator:1.0 + IDL:Administrator:1.0 + Administrator.idl + + + runnables + false + true + true + false + IDL:Runnable:1.0 + IDL:Runnable:1.0 + MultiplexReceptacle + + + + content + false + true + true + false + IDL:Publication:1.0 + IDL:Publication:1.0 + MultiplexReceptacle + + + + + comment + + + tk_string + + + This CCD describes the Administrator's interface + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid new file mode 100644 index 00000000000..af9e9a4c677 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid @@ -0,0 +1,34 @@ + + + + + + + Administrator_Stub + + + + Administrator_Svnt + + + + Administrator_Exec + + + + + ComponentIOR + + + tk_string + + + Administrator.ior + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd new file mode 100644 index 00000000000..972966462e6 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd @@ -0,0 +1,15 @@ + + + + + + + AdministratorImpl + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad new file mode 100644 index 00000000000..81b7a16da7a --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad @@ -0,0 +1,40 @@ + + + + Administrator_exec + + ACE/TAO/CIAO + + + + Administrator_Stub + + + + entryPoint + + + tk_string + + + createAdministratorHome_Impl + + + + + + comment + + + tk_string + + + This IAD describes the Administrator's executor library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad new file mode 100644 index 00000000000..931fc371710 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad @@ -0,0 +1,30 @@ + + + + Administrator_stub + + ACE/TAO/CIAO + + + + Messenger_Stub + + + + + + comment + + + tk_string + + + This IAD describes the Administrator's stub library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad new file mode 100644 index 00000000000..6774a107ef0 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad @@ -0,0 +1,40 @@ + + + + Administrator_svnt + + ACE/TAO/CIAO + + + + Administrator_Stub + + + + entryPoint + + + tk_string + + + createAdministratorHome_Servant + + + + + + comment + + + tk_string + + + This IAD describes the Administrator's servant library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp new file mode 100644 index 00000000000..d01ec12e2db --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp @@ -0,0 +1,255 @@ + + + + + + + + + + + MessengerImpl + + + Messenger_Stub + Messenger_Svnt + Messenger_Exec + + + + ReceiverImpl + + Receiver_Stub + Receiver_Svnt + Receiver_Exec + + + + AdministratorImpl + + Administrator_Stub + Administrator_Svnt + Administrator_Exec + + + + + + Messenger_Instance + Messenger_Node + + MessengerImpl + + + First_Receiver_Instance + First_Receiver_Node + + ReceiverImpl + + + Second_Receiver_Instance + Second_Receiver_Node + + ReceiverImpl + + + Administrator_Instance + Administrator_Node + + AdministratorImpl + + + + + + Messenger_to_First_Receiver_Publish + + message_publisher + EventPublisher + Messenger_Instance_ID + + + message_consumer + EventConsumer + First_Receiver_Instance_ID + + + + + Messenger_to_First_Receiver_History + + message_history + Facet + Messenger_Instance_ID + + + message_history + SimplexReceptacle + First_Receiver_Instance_ID + + + + + Messenger_to_Second_Receiver_Publish + + message_publisher + EventPublisher + Messenger_Instance_ID + + + message_consumer + EventConsumer + Second_Receiver_Instance_ID + + + + + Messenger_to_Second_Receiver_History + + message_history + Facet + Messenger_Instance_ID + + + message_history + SimplexReceptacle + Second_Receiver_Instance_ID + + + + + Messenger_to_Administrator_Control + + control + Facet + Messenger_Instance_ID + + + runnables + SimplexReceptacle + Administrator_Instance_ID + + + + + Messenger_to_Administrator_Content + + content + Facet + Messenger_Instance_ID + + + content + SimplexReceptacle + Administrator_Instance_ID + + + + + + + Messenger_Stub + + + Messenger_stub + + + Messenger_Svnt + + + Messenger_svnt + + entryPoint + + tk_string + create_MessengerHome_Servant + + + + + Messenger_Exec + + + Messenger_exec + + entryPoint + + tk_string + create_MessengerHome_Impl + + + + + + Receiver_Stub + + + Receiver_stub + + + Receiver_Svnt + + + Receiver_svnt + + entryPoint + + tk_string + create_ReceiverHome_Servant + + + + + Receiver_Exec + + + Receiver_exec + + entryPoint + + tk_string + create_ReceiverHome_Impl + + + + + + Administrator_Stub + + + Administrator_stub + + + Administrator_Svnt + + + Administrator_svnt + + entryPoint + + tk_string + create_AdministratorHome_Servant + + + + + Administrator_Exec + + + Administrator_exec + + entryPoint + + tk_string + create_AdministratorHome_Impl + + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp new file mode 100644 index 00000000000..9e774373c2f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp @@ -0,0 +1,25 @@ + + + + + Messenger_Instance + Messenger_Node + + + First_Receiver_Instance + First_Receiver_Node + + + Second_Receiver_Instance + Second_Receiver_Node + + + Administrator_Instance + Administrator_Node + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd new file mode 100644 index 00000000000..70635a4850b --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd @@ -0,0 +1,23 @@ + + + + + + + + subject + + + tk_string + + + My Subject + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat new file mode 100644 index 00000000000..91fbbfd4d20 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat @@ -0,0 +1,5 @@ +Administrator_Node corbaloc:iiop:localhost:11000/Administrator_Node.NodeManager +First_Receiver_Node corbaloc:iiop:localhost:22000/First_Receiver_Node.NodeManager +Second_Receiver_Node corbaloc:iiop:localhost:33000/Second_Receiver_Node.NodeManager +Messenger_Node corbaloc:iiop:localhost:44000/Messenger_Node.NodeManager + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd new file mode 100644 index 00000000000..ae9bc21965d --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd @@ -0,0 +1,776 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd new file mode 100644 index 00000000000..54a8c1f5a82 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd @@ -0,0 +1,24 @@ + + + + + Messenger_Node + + + + First_Receiver_Node + + + + Second_Receiver_Node + + + + Administrator_Node + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad new file mode 100644 index 00000000000..d861613c157 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad @@ -0,0 +1,11 @@ + + + + $ACE_ROOT/lib/ACE + $ACE_ROOT/lib/TAO + $ACE_ROOT/lib/CIAO_Client + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd new file mode 100644 index 00000000000..cf79d7fb9f7 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd @@ -0,0 +1,90 @@ + + + + IDL:Messenger:1.0 + Messenger.idl + + + subject + + tk_string + + + + + control + false + false + true + true + IDL:Runnable:1.0 + IDL:Runnable:1.0 + Facet + + + + content + false + false + true + true + IDL:Publication:1.0 + IDL:Publication:1.0 + Facet + + + + message_publisher + false + false + true + false + IDL:Message:1.0 + IDL:Message:1.0 + EventPublisher + + + + message_history + false + false + true + true + IDL:History:1.0 + IDL:History:1.0 + Facet + + + + + subject + + + tk_string + + + Default Subject + + + + + + + comment + + + tk_string + + + This CCD describes the Messenger's interface + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid new file mode 100644 index 00000000000..c4e934f1ee2 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid @@ -0,0 +1,37 @@ + + + + + + + Messenger_Stub + + + + Messenger_Svnt + + + + Messenger_Exec + + + + + + ComponentIOR + + + tk_string + + + Messenger.ior + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd new file mode 100644 index 00000000000..ee624b9bce5 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd @@ -0,0 +1,15 @@ + + + + + + + MessengerImpl + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd new file mode 100644 index 00000000000..c048d99133d --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd @@ -0,0 +1,31 @@ + + + + + + subject + + tk_string + + + + + + subject + + + tk_string + + + Default Subject + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid new file mode 100644 index 00000000000..bd0bf4e56ce --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid @@ -0,0 +1,110 @@ + + + + + + + Messenger_Instance + + + + First_Receiver_Instance + + + + Second_Receiver_Instance + + + + Administrator_Instance + + + + + Messenger_to_First_Receiver_Publish + + message_publisher + + + + message_consumer + + + + + Messenger_to_First_Receiver_History + + message_history + + + + message_history + + + + + + Messenger_to_Second_Receiver_Publisher + + message_publisher + + + + message_consumer + + + + + Messenger_to_Second_Receiver_History + + message_history + + + + message_history + + + + + + Messenger_to_Administrator_Control + + control + + + + runnables + + + + + Messenger_to_Administrator_Content + + content + + + + content + + + + + + + Subject Mapping + subject + + subject + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd new file mode 100644 index 00000000000..a719ad571c9 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd @@ -0,0 +1,13 @@ + + + + + + Messenger Application + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad new file mode 100644 index 00000000000..0b8cef2092c --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad @@ -0,0 +1,40 @@ + + + + Messenger_exec + + ACE/TAO/CIAO + + + + Messenger_Stub + + + + entryPoint + + + tk_string + + + createMessengerHome_Impl + + + + + + comment + + + tk_string + + + This IAD describes the Messenger's executor library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad new file mode 100644 index 00000000000..50447209f50 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad @@ -0,0 +1,25 @@ + + + + Messenger_stub + + ACE/TAO/CIAO + + + + + comment + + + tk_string + + + This IAD describes the Messenger's stub library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad new file mode 100644 index 00000000000..29b83d63e53 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad @@ -0,0 +1,40 @@ + + + + Messenger_svnt + + ACE/TAO/CIAO + + + + Messenger_Stub + + + + entryPoint + + + tk_string + + + createMessengerHome_Servant + + + + + + comment + + + tk_string + + + This IAD describes the Messenger's servant library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a new file mode 100644 index 00000000000..ac466837dc4 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a @@ -0,0 +1,5 @@ +Deployment has changed in CIAO 0.5a (part of TAO 1.5a), now we use the plan +launcher, which reads a single XML file called a flattened deployment plan. +In our example, that file is Application-flattened.cdp. All the other XML +files in this directory are here for reference and to correspond to the 1.4a +TAO Developer's Guide, but they are not actually used. diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd new file mode 100644 index 00000000000..3094ae368dc --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd @@ -0,0 +1,48 @@ + + + + IDL:Receiver:1.0 + IDL:Receiver:1.0 + Receiver.idl + + + message_consumer + false + false + false + true + IDL:Message:1.0 + IDL:Message:1.0 + EventConsumer + + + + message_history + false + true + true + false + IDL:History:1.0 + IDL:History:1.0 + SimplexReceptacle + + + + + comment + + + tk_string + + + This CCD describes the Receiver's interface + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid new file mode 100644 index 00000000000..c5c85d648da --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid @@ -0,0 +1,34 @@ + + + + + + + Receiver_Stub + + + + Receiver_Svnt + + + + Receiver_Exec + + + + + ComponentIOR + + + tk_string + + + Receiver.ior + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd new file mode 100644 index 00000000000..8b8ff890fa2 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd @@ -0,0 +1,11 @@ + + + + + + + ReceiverImpl + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad new file mode 100644 index 00000000000..adcee103c94 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad @@ -0,0 +1,40 @@ + + + + Receiver_exec + + ACE/TAO/CIAO + + + + Receiver_Stub + + + + entryPoint + + + tk_string + + + createReceiverHome_Impl + + + + + + comment + + + tk_string + + + This IAD describes the Receiver's executor library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad new file mode 100644 index 00000000000..63d7e37cc8e --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad @@ -0,0 +1,29 @@ + + + + Receiver_stub + + ACE/TAO/CIAO + + + + Messenger_Stub + + + + + comment + + + tk_string + + + This IAD describes the Receiver's stub library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad new file mode 100644 index 00000000000..8e3bf58d965 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad @@ -0,0 +1,40 @@ + + + + Receiver_svnt + + ACE/TAO/CIAO + + + + Receiver_Stub + + + + entryPoint + + + tk_string + + + createReceiverHome_Servant + + + + + + comment + + + tk_string + + + This IAD describes the Receiver's servant library + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd new file mode 100644 index 00000000000..f4adac91934 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat new file mode 100644 index 00000000000..f5815bb1f60 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat @@ -0,0 +1,7 @@ +1 +3 +1 +4 +Changing the publication text! +2 +5 diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd new file mode 100644 index 00000000000..f481b6bd789 --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd @@ -0,0 +1,8 @@ + + + + diff --git a/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl new file mode 100644 index 00000000000..e7554bfefae --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl @@ -0,0 +1,117 @@ +# $Id$ + +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +use Env (ACE_ROOT); +use lib "$ACE_ROOT/bin"; +use PerlACE::Run_Test; + +$emior= PerlACE::LocalFile ("em.ior"); +unlink $emior; +$plior= PerlACE::LocalFile ("pl.ior"); +unlink $plior; + +if (defined $ENV{'CIAO_ROOT'}) { + $CIAO_ROOT = $ENV{'CIAO_ROOT'}; +} +else { + $CIAO_ROOT = $ACE_ROOT/TAO/CIAO; +} + +if (defined $ENV{'DANCE_ROOT'}) { + $DANCE_ROOT = $ENV{'DANCE_ROOT'}; +} +else { + $DANCE_ROOT = $ACE_ROOT/TAO/CIAO/DAnCE; +} + + +$NA = new PerlACE::Process ("$CIAO_ROOT/bin/ciao_componentserver"); +$NA_cmd = $NA->Executable (); + +$NA1 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:11000 -s $NA_cmd -n Administrator_Node"); + +$NA2 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:22000 -s $NA_cmd -n First_Receiver_Node"); + +$NA3 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:33000 -s $NA_cmd -n Second_Receiver_Node"); + +$NA4 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:44000 -s $NA_cmd -n Messenger_Node"); + +# Each Node Manager lauches a Node Application process. +open(STDIN, "Spawn (); +if($Ret1 == -1) { + print STDERR "ERROR: Administrator returned <$Ret1>\n" +} + +$Ret2 = $NA2->Spawn (); +if($Ret2 == -1) { + print STDERR "ERROR: Receiver 1 returned <$Ret2>\n" +} + +$Ret3 = $NA3->Spawn (); +if($Ret3 == -1) { + print STDERR "ERROR: Receiver 2 returned <$Ret3>\n" +} + +$Ret4 = $NA4->Spawn (); +if($Ret4 == -1) { + print STDERR "ERROR: Messenger returned <$Ret4>\n" +} + +#Start an Execution Manager +$EM = new PerlACE::Process ("$DANCE_ROOT/bin/dance_execution_manager", "-e$emior --node-map ApplicationNodeMap.dat"); + +$Ret5 = $EM->Spawn (); +if($Ret5 == -1) { + print STDERR "ERROR: Execution Manager returned <$Ret5>\n" +} + +if (PerlACE::waitforfile_timed ($emior, 5) == -1) { + print STDERR "ERROR: cannot find file <$emior>\n"; + $EM->Kill(); + unlink $emior; + exit 1; +} + +sleep(5); +#Start the plan laucnher +$EX = new PerlACE::Process ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x Application-flattened_Unhomed.cdp -k file://$emior "); + +#Stop the plan launcher +$EX2 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$emior -x Application-flattened_Unhomed.cdp"); + +$Ret6 = $EX->Spawn (); +if($Ret6 == -1) { + print STDERR "ERROR: plan launcher returned <$Ret6>\n" +} + +sleep(10); + +$Ret7 = $EX2->Spawn (); +if($Ret7 == -1) { + print STDERR "ERROR: plan launcher (shutdown) returned <$Ret7>\n" +} + +sleep(5); + +$NA1->Kill(); +$NA2->Kill(); +$NA3->Kill(); +$NA4->Kill(); +$EX->Kill(); +$EX2->Kill(); +$EM->Kill(); + +unlink $emior; +unlink $plior; + +exit 0; diff --git a/flat/CIAO/examples/DevGuideExamples/readme.txt b/flat/CIAO/examples/DevGuideExamples/readme.txt new file mode 100644 index 00000000000..f6efa4d084f --- /dev/null +++ b/flat/CIAO/examples/DevGuideExamples/readme.txt @@ -0,0 +1,12 @@ +"These examples were developed by and are included in this +distribution with the permission of Object Computing, Inc. (OCI) +for the purpose of illustrating the usage of certain features of +The ACE ORB (TAO) as described in OCI's TAO Developer's Guide. +They are provided as is with no warranty, expressed or implied. +Though the examples are believed to illustrate correct usage of +TAO, OCI does not actively maintain them in this distribution and +does not guarantee their accuracy or their suitability for any +particular use. OCI does provide additional distributions of TAO +and provides commercial support for TAO. Visit +http://www.theaceorb.com or contact sales@ociweb.com for more +information on OCI's business model with respect to TAO." \ No newline at end of file -- cgit v1.2.1