summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdullah Sowayan <sowayan@users.noreply.github.com>2008-10-21 20:47:43 +0000
committerAbdullah Sowayan <sowayan@users.noreply.github.com>2008-10-21 20:47:43 +0000
commitd2911d5b9eb897d3da7d458ebf5ba8b998bc7763 (patch)
tree3158327d3787df5b439329fac177f20a12857c62
parentf8ea2bc5a4d98525f6f290d8272663e46aa1de74 (diff)
downloadATCD-d2911d5b9eb897d3da7d458ebf5ba8b998bc7763.tar.gz
Tue Oct 21 19:10:21 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
-rw-r--r--TAO/ChangeLog7
-rw-r--r--TAO/DevGuideExamples/AMH/AMH.mpc20
-rw-r--r--TAO/DevGuideExamples/AMH/AMH_Messenger_i.cpp39
-rw-r--r--TAO/DevGuideExamples/AMH/AMH_Messenger_i.h38
-rw-r--r--TAO/DevGuideExamples/AMH/Messenger.idl11
-rw-r--r--TAO/DevGuideExamples/AMH/MessengerClient.cpp40
-rw-r--r--TAO/DevGuideExamples/AMH/MessengerServer.cpp44
-rw-r--r--TAO/DevGuideExamples/AMH/Messenger_i.cpp35
-rw-r--r--TAO/DevGuideExamples/AMH/Messenger_i.h37
-rw-r--r--TAO/DevGuideExamples/AMH/README43
-rw-r--r--TAO/DevGuideExamples/AMH/amh_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/AMH/amh_pch.h10
-rw-r--r--TAO/DevGuideExamples/AMH/run_test.pl44
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/AMH_AMI.mpc51
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/README53
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.h10
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/client.cpp45
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner.idl7
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner_cb.cpp60
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner_cb.h28
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner_i.cpp31
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner_i.h34
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/inner_server.cpp67
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/middle.idl6
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/middle_i.cpp59
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/middle_i.h46
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/middle_server.cpp81
-rw-r--r--TAO/DevGuideExamples/AMH_AMI/run_test.pl58
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/BiDirectionalGIOP.mpc23
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/README27
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.h15
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/callback.idl10
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.cpp26
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.h22
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/client.cpp101
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl39
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/server.cpp115
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/simple.idl14
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.cpp77
-rw-r--r--TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.h46
-rw-r--r--TAO/DevGuideExamples/CIAO/CIAO.mwc2
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator.cidl22
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator.idl22
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator.mpc96
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client.cpp121
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.cpp8
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.mpc45
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.cpp8
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.mpc29
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.cpp278
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.h138
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_stub_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Administrator_svnt_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/History.idl17
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.cpp100
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.h76
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Message.idl19
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger.cidl22
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger.idl28
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger.mpc109
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.cpp273
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.h167
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger_stub_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Messenger_svnt_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Publication.idl15
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.cpp89
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.h79
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver.cidl21
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver.idl21
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver.mpc96
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.cpp196
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.h131
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver_stub_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Receiver_svnt_export.h54
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Runnable.idl15
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.cpp63
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.h70
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc18
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/README.txt33
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/StaticDAnCEApp.cpp119
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/plan.h42
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/run_test.pl108
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.ccd47
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cid34
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cpd15
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Exec.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Stub.iad30
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Svnt.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application-flattened.cdp255
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.cdp25
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.pcd23
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/ApplicationNodeMap.dat4
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Deployment.xsd776
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Domain.cdd24
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Libraries.iad11
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.ccd90
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cid37
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cpd15
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.ccd31
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cid110
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cpd13
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Exec.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Stub.iad25
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Svnt.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/README_15a5
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.ccd48
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cid34
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cpd11
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Exec.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Stub.iad29
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Svnt.iad40
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/XMI.xsd35
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/admin.dat7
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/package.tpd8
-rw-r--r--TAO/DevGuideExamples/CIAO/Messenger/descriptors/run_test.pl109
-rw-r--r--TAO/DevGuideExamples/ChangeLog498
-rw-r--r--TAO/DevGuideExamples/ChangeLogs/ChangeLog-1.4a1932
-rw-r--r--TAO/DevGuideExamples/DevGuideExamples.mwc3
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumerMain.cpp83
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.cpp42
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.h29
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventSupplierMain.cpp70
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/OMG_Basic.mpc18
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/README62
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl61
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp81
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp42
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h29
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp88
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc19
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/README61
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/run_test.pl48
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/ConsumerMain.cpp103
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp39
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.h32
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger.idl10
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.cpp40
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.h46
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/OMG_TypedEC.mpc19
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/README17
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/SupplierMain.cpp74
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_TypedEC/run_test.pl94
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumerMain.cpp88
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.cpp56
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplierMain.cpp107
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.cpp24
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.h22
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/README57
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/RTEC_Basic.mpc20
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Basic/run_test.pl60
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumerMain.cpp103
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.cpp56
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp204
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.cpp24
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.h22
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/README84
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/RTEC_Federated.mpc20
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/run_test.pl94
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Federated/supplier.conf6
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumerMain.cpp91
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.cpp56
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplierMain.cpp118
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.cpp25
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.h22
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/README57
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/RTEC_Filter.mpc20
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/ec.conf2
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_Filter/run_test.pl61
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp103
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp56
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp243
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp24
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.h22
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/README138
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc21
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp41
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.h27
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/run_test.pl144
-rw-r--r--TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/supplier.conf2
-rw-r--r--TAO/DevGuideExamples/GettingStarted/GettingStarted.mpc17
-rw-r--r--TAO/DevGuideExamples/GettingStarted/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/GettingStarted/MessengerClient.cpp40
-rw-r--r--TAO/DevGuideExamples/GettingStarted/MessengerServer.cpp45
-rw-r--r--TAO/DevGuideExamples/GettingStarted/Messenger_i.cpp36
-rw-r--r--TAO/DevGuideExamples/GettingStarted/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/GettingStarted/README43
-rw-r--r--TAO/DevGuideExamples/GettingStarted/run_test.pl44
-rw-r--r--TAO/DevGuideExamples/GettingStarted/started_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/GettingStarted/started_pch.h10
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Activator/run_test.pl121
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/ImplRepo_Basic.mpc13
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/Messenger.idl3
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/MessengerClient.cpp26
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/MessengerServer.cpp74
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.cpp16
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.h17
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Basic/run_test.pl92
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/ImplRepo_IORTable.mpc13
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/Messenger.idl3
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/MessengerClient.cpp35
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/MessengerServer.cpp93
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.cpp17
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.h17
-rw-r--r--TAO/DevGuideExamples/ImplRepo/IORTable/run_test.pl129
-rw-r--r--TAO/DevGuideExamples/ImplRepo/ImplRepo.mpc13
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/ImplRepo/MessengerClient.cpp36
-rw-r--r--TAO/DevGuideExamples/ImplRepo/MessengerServer.cpp101
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Messenger_i.cpp32
-rw-r--r--TAO/DevGuideExamples/ImplRepo/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/ImplRepo/README28
-rw-r--r--TAO/DevGuideExamples/ImplRepo/run_test.pl108
-rw-r--r--TAO/DevGuideExamples/InterfaceRepo/IFRBrowser.cpp277
-rw-r--r--TAO/DevGuideExamples/InterfaceRepo/InterfaceRepo.mpc3
-rw-r--r--TAO/DevGuideExamples/InterfaceRepo/run_test.pl84
-rw-r--r--TAO/DevGuideExamples/InterfaceRepo/test.idl14
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.mpc2
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/MessengerServer.cpp27
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.cpp29
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.h32
-rw-r--r--TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl15
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerClient.cpp37
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.cpp56
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.h31
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerServer.cpp76
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.cpp45
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.h48
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/ServantLocator.mpc14
-rw-r--r--TAO/DevGuideExamples/LocalObjects/ServantLocator/run_test.pl35
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/AMIcallback.mpc26
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/Messenger.idl15
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/MessengerClient.cpp98
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.cpp58
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.h38
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/MessengerServer.cpp65
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.cpp60
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.h51
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/README39
-rw-r--r--TAO/DevGuideExamples/Messaging/AMIcallback/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerClient.cpp74
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerServer.cpp41
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.cpp38
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/README40
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc13
-rw-r--r--TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/GracefulShutdown.mpc16
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger.idl11
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerClient.cpp81
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp221
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.h74
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.cpp17
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.h24
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.cpp43
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.h44
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/README63
-rw-r--r--TAO/DevGuideExamples/Multithreading/GracefulShutdown/run_test.pl203
-rw-r--r--TAO/DevGuideExamples/Multithreading/README21
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/MessengerClient.cpp36
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/MessengerServer.cpp42
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.cpp37
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/README48
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/Reactive.mpc13
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/run_test.pl44
-rw-r--r--TAO/DevGuideExamples/Multithreading/Reactive/svc.conf4
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerClient.cpp36
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerServer.cpp42
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.cpp41
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/README71
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/ThreadPerConnection.mpc13
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/run_test.pl74
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPerConnection/server.conf2
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerClient.cpp36
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerServer.cpp73
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.cpp41
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/README74
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/ThreadPool.mpc13
-rw-r--r--TAO/DevGuideExamples/Multithreading/ThreadPool/run_test.pl113
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/Messenger.mpc13
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/MessengerClient.cpp50
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/MessengerServer.cpp63
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.cpp34
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/README43
-rw-r--r--TAO/DevGuideExamples/NamingService/Messenger/run_test.pl58
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/MessengerClient.cpp46
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/MessengerServer.cpp62
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.cpp36
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/Naming_Client.mpc13
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/README45
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Client/run_test.pl61
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerClient.cpp50
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerServer.cpp127
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.cpp36
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc13
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/README32
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Context_Ext/run_test.pl54
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.cpp82
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.h18
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.cpp37
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.h39
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/NamingMessenger.cpp23
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.cpp64
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.h22
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/Naming_Server.mpc3
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/README39
-rw-r--r--TAO/DevGuideExamples/NamingService/Naming_Server/run_test.pl18
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerClient.cpp53
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerServer.cpp63
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.cpp33
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/README171
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc13
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaloc_Messenger/run_test.pl109
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerClient.cpp42
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerServer.cpp62
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.cpp33
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/README64
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/corbaname_Messenger.mpc13
-rw-r--r--TAO/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl70
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/EventSequence.mpc24
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.cpp50
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.h28
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.cpp31
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.h23
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/Messenger.idl7
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/MessengerClient.cpp39
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/MessengerConsumer.cpp86
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/MessengerServer.cpp51
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.cpp125
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.h36
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/README63
-rw-r--r--TAO/DevGuideExamples/NotifyService/EventSequence/run_test.pl75
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/Filtering.mpc27
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/MessengerClient.cpp61
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/MessengerConsumer.cpp156
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/MessengerServer.cpp94
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.cpp161
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.h34
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/README62
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.cpp53
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.h33
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.cpp33
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.h28
-rw-r--r--TAO/DevGuideExamples/NotifyService/Filtering/run_test.pl75
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/Messenger.mpc23
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/MessengerClient.cpp39
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/MessengerConsumer.cpp101
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/MessengerServer.cpp48
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.cpp127
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.h29
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/README64
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.cpp50
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.cpp31
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.h24
-rw-r--r--TAO/DevGuideExamples/NotifyService/Messenger/run_test.pl75
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerClient.cpp52
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerConsumer.cpp116
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerServer.cpp63
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.cpp163
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.h30
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/OfferSubscriptions.mpc23
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/README66
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp49
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.h29
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp31
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.h23
-rw-r--r--TAO/DevGuideExamples/NotifyService/OfferSubscriptions/run_test.pl75
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerClient.cpp40
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerConsumer.cpp100
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerServer.cpp46
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.cpp140
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.h29
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/QoSProperties.mpc23
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/README55
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.cpp58
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.h38
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.cpp36
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.h29
-rw-r--r--TAO/DevGuideExamples/NotifyService/QoSProperties/run_test.pl75
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/Messenger.idl8
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/MessengerClient.cpp39
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/MessengerConsumer.cpp183
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/MessengerServer.cpp48
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.cpp157
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.h31
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/Priorities.h8
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/README67
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/RTNotify.mpc23
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.cpp50
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.h31
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.cpp31
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.h24
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/notify.conf6
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/nsclient.conf4
-rw-r--r--TAO/DevGuideExamples/NotifyService/RTNotify/run_test.pl80
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger.idl14
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerClient.cpp56
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerConsumer.cpp139
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerServer.cpp59
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerSupplier.cpp95
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.cpp172
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.h34
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/README43
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp50
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.h29
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp31
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.h25
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/SupplierSideNC.mpc23
-rw-r--r--TAO/DevGuideExamples/NotifyService/SupplierSideNC/run_test.pl56
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/Auth.mpc17
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.cpp36
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.h19
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.cpp96
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.h46
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerClient.cpp50
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerServer.cpp59
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.cpp43
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.h41
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/README36
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.cpp44
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.h23
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.cpp116
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.h45
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/Auth/run_test.pl36
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.cpp45
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.h21
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.cpp123
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.h48
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/IOR.mpc18
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger.idl6
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerClient.cpp84
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerServer.cpp59
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.cpp75
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.h29
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/README35
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.cpp40
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.h50
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.cpp32
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.h23
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.cpp125
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.h47
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/IOR/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.cpp56
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.h25
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp109
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.h43
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger.idl10
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerClient.cpp52
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerServer.cpp63
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.cpp51
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.h37
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/PICurrent.mpc17
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/README34
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.cpp22
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.h21
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.cpp98
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.h34
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp70
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.h25
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp124
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.h53
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger.idl10
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerClient.cpp62
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerServer.cpp72
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.cpp61
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.h47
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc17
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/README42
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.cpp24
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.h23
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp112
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.h45
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl46
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.cpp31
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.h21
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.cpp106
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.h49
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger.idl6
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerClient.cpp85
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp61
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.cpp74
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.h28
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/README36
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.cpp27
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.h23
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.cpp126
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.h47
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/SimpleCode.mpc17
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/run_test.pl36
-rw-r--r--TAO/DevGuideExamples/RTCORBA/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/RTCORBA/MessengerClient.cpp87
-rw-r--r--TAO/DevGuideExamples/RTCORBA/MessengerServer.cpp96
-rw-r--r--TAO/DevGuideExamples/RTCORBA/Messenger_i.cpp37
-rw-r--r--TAO/DevGuideExamples/RTCORBA/Messenger_i.h40
-rw-r--r--TAO/DevGuideExamples/RTCORBA/README18
-rw-r--r--TAO/DevGuideExamples/RTCORBA/RTCORBA.mpc17
-rw-r--r--TAO/DevGuideExamples/RTCORBA/common.cpp20
-rw-r--r--TAO/DevGuideExamples/RTCORBA/common.h9
-rw-r--r--TAO/DevGuideExamples/RTCORBA/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/RTCORBA/svc.conf3
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/Messenger.idl13
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/MessengerClient.cpp115
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/MessengerServer.cpp64
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.cpp156
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.h40
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/ParticipatingApp.mpc15
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/README47
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/cacert.pem22
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/client.conf6
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/clientcert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/clientkey.pem15
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/run_test.pl38
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/server.conf5
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/servercert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/ParticipatingApp/serverkey.pem15
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger.idl11
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerClient.cpp187
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerServer.cpp46
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.cpp28
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.h32
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/PolicyControllingApp.mpc13
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/README144
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/cacert.pem22
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/client.conf6
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/client1.conf6
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/clientcert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/clientkey.pem15
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/run_test.pl67
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/server.conf5
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/server1.conf5
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/servercert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/PolicyControllingApp/serverkey.pem15
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger.idl11
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp39
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerI.cpp46
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerServer.cpp46
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.cpp35
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.h32
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/README172
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/SecurityUnawareApp.mpc13
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/cacert.pem22
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/client.conf4
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/client1.conf4
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/clientcert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/clientkey.pem15
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/run_test.pl62
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/server.conf4
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/servercert.pem17
-rw-r--r--TAO/DevGuideExamples/Security/SecurityUnawareApp/serverkey.pem15
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Logger.idl6
-rw-r--r--TAO/DevGuideExamples/SmartProxies/LoggerServer.cpp45
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Logger_i.cpp25
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Logger_i.h25
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Messenger.idl9
-rw-r--r--TAO/DevGuideExamples/SmartProxies/MessengerClient.cpp50
-rw-r--r--TAO/DevGuideExamples/SmartProxies/MessengerServer.cpp44
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Messenger_i.cpp34
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Messenger_i.h37
-rw-r--r--TAO/DevGuideExamples/SmartProxies/README25
-rw-r--r--TAO/DevGuideExamples/SmartProxies/SmartProxies.mpc42
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.cpp58
-rw-r--r--TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.h30
-rw-r--r--TAO/DevGuideExamples/SmartProxies/run_test.pl52
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/README35
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/_pch.h10
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/bank.idl13
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/bank.mpc17
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/client.cpp67
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Bank/server.cpp101
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.cpp96
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.h47
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/Messenger.idl27
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/MessengerClient.cpp46
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/MessengerServer.cpp46
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.cpp25
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.h13
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/README44
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/ValueTypes.mpc20
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/_pch.cpp1
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/_pch.h10
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Messenger/run_test.pl37
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/Event.idl14
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/Event_i.h64
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/Notify.mpc20
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/consumer.cpp177
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/notify.conf2
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/readme.txt2
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/run_test.pl79
-rw-r--r--TAO/DevGuideExamples/ValueTypes/Notify/supplier.cpp214
-rw-r--r--TAO/DevGuideExamples/devguide_examples.lst47
-rw-r--r--TAO/DevGuideExamples/readme.txt34
628 files changed, 32805 insertions, 0 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 591f6c9650f..be2bc0cb971 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 21 19:10:21 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
+
+ * DevGuideExamples:
+
+ Added examples from the OCI distribution. Special thanks to OCI
+ for contributing the examples.
+
Tue Oct 21 15:59:59 UTC 2008 Vladimir Zykov <vzykov@prismtech.com>
* tests/Bug_1495_Regression/Client_Task.cpp:
diff --git a/TAO/DevGuideExamples/AMH/AMH.mpc b/TAO/DevGuideExamples/AMH/AMH.mpc
new file mode 100644
index 00000000000..8a36a59d928
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/AMH.mpc
@@ -0,0 +1,20 @@
+project(*Server): taoexe, portableserver, amh {
+ idlflags += -Wb,pch_include=amh_pch.h
+
+ Source_Files {
+ AMH_Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+// This project doesn't really require AMH, but since they
+// are in the same directory and share the generated idl code
+// it has to be there.
+project(*Client): taoexe, amh {
+ idlflags += -Wb,pch_include=amh_pch.h
+
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/AMH/AMH_Messenger_i.cpp b/TAO/DevGuideExamples/AMH/AMH_Messenger_i.cpp
new file mode 100644
index 00000000000..2fdbf6e927e
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/AMH_Messenger_i.cpp
@@ -0,0 +1,39 @@
+#include "amh_pch.h"
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "AMH_Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+AMH_Messenger_i::AMH_Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+AMH_Messenger_i::~AMH_Messenger_i (void)
+{
+}
+
+void
+AMH_Messenger_i::send_message (
+ DevGuide::AMH_MessengerResponseHandler_ptr _tao_rh,
+ const char * user_name,
+ const char * subject,
+ const char * message
+ )
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::String_var inout_message_arg =
+ CORBA::string_dup("Thanks for the message.");
+ CORBA::Boolean result = 1;
+
+ _tao_rh->send_message(result,inout_message_arg.inout ());
+}
diff --git a/TAO/DevGuideExamples/AMH/AMH_Messenger_i.h b/TAO/DevGuideExamples/AMH/AMH_Messenger_i.h
new file mode 100644
index 00000000000..150ff7059a3
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/AMH_Messenger_i.h
@@ -0,0 +1,38 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef AMH_MESSENGER_I_H_
+#define AMH_MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class AMH_Messenger_i
+class AMH_Messenger_i : public virtual POA_DevGuide::AMH_Messenger
+{
+public:
+ //Constructor
+ AMH_Messenger_i (void);
+
+ //Destructor
+ virtual ~AMH_Messenger_i (void);
+
+ virtual void send_message (
+ DevGuide::AMH_MessengerResponseHandler_ptr _tao_rh,
+ const char * user_name,
+ const char * subject,
+ const char * message
+ );
+};
+
+
+#endif /* AMH_MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/AMH/Messenger.idl b/TAO/DevGuideExamples/AMH/Messenger.idl
new file mode 100644
index 00000000000..b307589b231
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/Messenger.idl
@@ -0,0 +1,11 @@
+// Messenger.idl
+
+module DevGuide
+{
+ interface Messenger
+ {
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+ };
+};
diff --git a/TAO/DevGuideExamples/AMH/MessengerClient.cpp b/TAO/DevGuideExamples/AMH/MessengerClient.cpp
new file mode 100644
index 00000000000..8ae0fe979d6
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/MessengerClient.cpp
@@ -0,0 +1,40 @@
+#include "amh_pch.h"
+
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ DevGuide::Messenger_var messenger =
+ DevGuide::Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var msg = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", msg.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << msg.in() << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH/MessengerServer.cpp b/TAO/DevGuideExamples/AMH/MessengerServer.cpp
new file mode 100644
index 00000000000..f17c9cabd9d
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/MessengerServer.cpp
@@ -0,0 +1,44 @@
+#include "amh_pch.h"
+
+#include "AMH_Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ AMH_Messenger_i servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid = poa->activate_object( &servant );
+ obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH/Messenger_i.cpp b/TAO/DevGuideExamples/AMH/Messenger_i.cpp
new file mode 100644
index 00000000000..c825da18737
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/Messenger_i.cpp
@@ -0,0 +1,35 @@
+#include "amh_pch.h"
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::string_free(message);
+ message = CORBA::string_dup("Thanks for the message.");
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH/Messenger_i.h b/TAO/DevGuideExamples/AMH/Messenger_i.h
new file mode 100644
index 00000000000..8783559712b
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/Messenger_i.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ );
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/AMH/README b/TAO/DevGuideExamples/AMH/README
new file mode 100644
index 00000000000..1ae24245c7b
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/README
@@ -0,0 +1,43 @@
+File: DevGuideExamples/GettingStarted/README
+
+
+This directory contains a CORBA example illustrating a simple client and
+a server with a Interface Messenger. The Messenger Interface has
+an operation for sending a message (send_message). The MessengerClient
+will send a message which is displayed by the MessengerServer when
+received. The MessengerClient will then confirm that the message has
+been sent successfully.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/AMH/amh_pch.cpp b/TAO/DevGuideExamples/AMH/amh_pch.cpp
new file mode 100644
index 00000000000..ab632ec71cb
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/amh_pch.cpp
@@ -0,0 +1 @@
+#include "amh_pch.h"
diff --git a/TAO/DevGuideExamples/AMH/amh_pch.h b/TAO/DevGuideExamples/AMH/amh_pch.h
new file mode 100644
index 00000000000..1b4e8d10348
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/amh_pch.h
@@ -0,0 +1,10 @@
+#ifndef PCH_H
+#define PCH_H
+
+#ifdef USING_PCH
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+#include <tao/Stub.h>
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/AMH/run_test.pl b/TAO/DevGuideExamples/AMH/run_test.pl
new file mode 100644
index 00000000000..7c83927dfc1
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH/run_test.pl
@@ -0,0 +1,44 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+# start MessengerServer
+
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C = new PerlACE::Process("MessengerClient");
+$C->Spawn();
+
+$CRET = $C->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/AMH_AMI/AMH_AMI.mpc b/TAO/DevGuideExamples/AMH_AMI/AMH_AMI.mpc
new file mode 100644
index 00000000000..cd76f03f84c
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/AMH_AMI.mpc
@@ -0,0 +1,51 @@
+project(*Client): taoexe, portableserver, messaging {
+ after += *Middle_Server
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ middleC.cpp
+ client.cpp
+ }
+ // To avoid link errors with SunCC 5.[34], put this project's
+ // object files (and resulting SunWS_cache directory) in a different
+ // location than the default.
+ verbatim(gnuace, macros) {
+ VDIR := .obj/AMH_AMI_Client/
+ }
+}
+
+project(*Middle_Server): messaging, taoexe, portableserver, amh {
+ idlflags += -Wb,pch_include=amh_ami_pch.h
+ after += *Inner_Server
+
+ IDL_Files {
+ middle.idl
+ }
+
+ Source_Files {
+ middleS.cpp
+ middleC.cpp
+ innerS.cpp
+ innerC.cpp
+ middle_i.cpp
+ middle_server.cpp
+ inner_cb.cpp
+ }
+}
+
+project(*Inner_Server): messaging, taoexe, portableserver, ami {
+ idlflags += -Wb,pch_include=amh_ami_pch.h
+
+ IDL_Files {
+ inner.idl
+ }
+
+ Source_Files {
+ innerS.cpp
+ innerC.cpp
+ inner_i.cpp
+ inner_server.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/README b/TAO/DevGuideExamples/AMH_AMI/README
new file mode 100644
index 00000000000..3732baaed97
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/README
@@ -0,0 +1,53 @@
+File: DevGuideExamples/AMH_AMI/README
+
+The example in this directory demonstrates how AMH can be coupled with
+AMI to create very efficient and scalable middle components for
+multi-tier applications. In this case, a client connects to a middle
+server which in turn is connected to an inner server. the client
+submits a question to the middle server, which forwards the question
+on to the inner server. The inner server then waits a few seconds, to
+simulate a busy process, then replies. The reply is handled
+asynchronously by the middle server, using AMI, then forwarded to the
+original client using AMH. Neither the client nor the inner server are
+aware of the asynchronous nature of the middle server.
+
+The inner server has a single startup option, -crash. When supplied,
+the server will induce an exception when invoked, rather than
+returning the answer.
+
+The middle server also has a single option, -no_AMH. When run in this
+mode, the IOR it publishes will refer to an object that does not use
+AMH and AMI. This allows you to compare the behavior and source code
+for these two modes of operation.
+
+How to Run
+----------
+
+Start the inner server (writes inner.ior) :
+------------------
+./inner_server [-crash]
+
+
+Then start the middle server (writes middle.ior):
+------------------
+./middle_server [-no_AMH]
+
+Finally, run the client:
+------------------
+./client
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
diff --git a/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.cpp b/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.cpp
new file mode 100644
index 00000000000..b7aa56c8c40
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.cpp
@@ -0,0 +1 @@
+#include "amh_ami_pch.h"
diff --git a/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.h b/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.h
new file mode 100644
index 00000000000..1b4e8d10348
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/amh_ami_pch.h
@@ -0,0 +1,10 @@
+#ifndef PCH_H
+#define PCH_H
+
+#ifdef USING_PCH
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+#include <tao/Stub.h>
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/AMH_AMI/client.cpp b/TAO/DevGuideExamples/AMH_AMI/client.cpp
new file mode 100644
index 00000000000..1a90fa27081
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/client.cpp
@@ -0,0 +1,45 @@
+#include "amh_ami_pch.h"
+
+#include "middleC.h"
+
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Asynch_Except_Demo object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://middle.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get middle IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Asycnh_Except_Demo object reference.
+ Middle_var mid = Middle::_narrow( obj.in() );
+ if( CORBA::is_nil( mid.in() ) ) {
+ std::cerr << "IOR was not an middle object reference." << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var question =
+ CORBA::string_dup ("How much wood would a woodchuck chuck, if a woodchuck could chuck wood?");
+
+ std::cout << "Question is: " << question.in() << std::endl;
+
+
+ // trigger the exception via AMI call
+ CORBA::String_var answer =
+ mid->get_the_answer (question.in());
+
+ std::cout << "Answer is: " << answer.in() << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner.idl b/TAO/DevGuideExamples/AMH_AMI/inner.idl
new file mode 100644
index 00000000000..77a86167084
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner.idl
@@ -0,0 +1,7 @@
+// file: inner.idl
+
+
+interface Inner
+{
+ string answer (in string question);
+};
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner_cb.cpp b/TAO/DevGuideExamples/AMH_AMI/inner_cb.cpp
new file mode 100644
index 00000000000..6ce5e712976
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner_cb.cpp
@@ -0,0 +1,60 @@
+#include "amh_ami_pch.h"
+#include "inner_cb.h"
+#include <iostream>
+// Implementation skeleton constructor
+Inner_callback_i::Inner_callback_i (PortableServer::POA_ptr p,
+ AMH_MiddleResponseHandler_ptr rh)
+ : poa_(PortableServer::POA::_duplicate (p)),
+ response_handler_ (AMH_MiddleResponseHandler::_duplicate (rh))
+{
+}
+
+// Implementation skeleton destructor
+Inner_callback_i::~Inner_callback_i (void)
+{
+ std::cout << "Inner_callback_i destroying" << std::endl;
+
+}
+
+void
+Inner_callback_i::answer (const char * ami_return_val)
+{
+ std::cout << "Inner_callback_i::answer called, return_val = "
+ << ami_return_val << std::endl;
+ this->response_handler_->get_the_answer (ami_return_val);
+
+ std::cout << "inner_callback_i deactivating self" << std::endl;
+ PortableServer::ObjectId_var oid = this->poa_->servant_to_id(this);
+ this->poa_->deactivate_object (oid.in());
+}
+
+void
+Inner_callback_i::answer_excep (Messaging::ExceptionHolder* excep_holder)
+{
+ // Here, we need to extract the exception from this holder, and package
+ // it in another so the AMH response handler may forward it on.
+ try
+ {
+ excep_holder->raise_exception();
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ CORBA::Exception *local_ex = ex._tao_duplicate();
+ AMH_MiddleExceptionHolder amh_excep_holder (local_ex);
+ this->response_handler_->get_the_answer_excep (&amh_excep_holder);
+ }
+ catch(...)
+ {
+ std::cout
+ << "inner_callback_i::answer_excep got an unknown exception"
+ << std::endl;
+
+ CORBA::Exception *unknown_ex = new CORBA::UNKNOWN;
+ AMH_MiddleExceptionHolder amh_excep_holder (unknown_ex);
+ this->response_handler_->get_the_answer_excep (&amh_excep_holder);
+ }
+
+ std::cout << "inner_callback_i deactivating self" << std::endl;
+ PortableServer::ObjectId_var oid = this->poa_->servant_to_id(this);
+ this->poa_->deactivate_object (oid.in());
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner_cb.h b/TAO/DevGuideExamples/AMH_AMI/inner_cb.h
new file mode 100644
index 00000000000..cca0c349eac
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner_cb.h
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+#ifndef INNER_CB_H
+#define INNER_CB_H
+
+#include "innerS.h"
+#include "middleC.h"
+
+class Inner_callback_i : public virtual POA_AMI_InnerHandler,
+ public virtual PortableServer::RefCountServantBase
+{
+public:
+ //Constructor
+ Inner_callback_i (PortableServer::POA_ptr p,
+ AMH_MiddleResponseHandler_ptr rh);
+
+ //Destructor
+ virtual ~Inner_callback_i(void);
+
+ virtual void answer (const char * ami_return_val);
+
+ virtual void answer_excep (Messaging::ExceptionHolder * excep_holder);
+
+private:
+ PortableServer::POA_var poa_;
+ AMH_MiddleResponseHandler_var response_handler_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner_i.cpp b/TAO/DevGuideExamples/AMH_AMI/inner_i.cpp
new file mode 100644
index 00000000000..71a7020a330
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner_i.cpp
@@ -0,0 +1,31 @@
+#include "amh_ami_pch.h"
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "inner_i.h"
+#include <ace/OS.h>
+
+Inner_i::Inner_i (int d)
+ : divisor_ (d)
+{
+}
+
+char *
+Inner_i::answer (const char * question)
+{
+ ACE_UNUSED_ARG (question); // doesn't matter
+
+ CORBA::String_var answer =
+ CORBA::string_dup ("I didn't know dogs could talk!");
+
+ int delay = 5/this->divisor_; // throw exception if divisor = 0
+
+ ACE_OS::sleep(delay); // make the caller wait a bit
+ return answer._retn();
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner_i.h b/TAO/DevGuideExamples/AMH_AMI/inner_i.h
new file mode 100644
index 00000000000..fbdbd5ee8fa
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner_i.h
@@ -0,0 +1,34 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef AMH_INNER_I_H_
+#define AMH_INNER_I_H_
+
+#include "innerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Inner_i : public virtual POA_Inner,
+ public virtual PortableServer::RefCountServantBase
+{
+public:
+ // ctor takes a 1 to delay and return string, a 0 to crash
+ Inner_i (int d);
+
+ // will either return a string after a brief delay, or crash
+ virtual char * answer (const char *question);
+
+private:
+ int divisor_;
+};
+
+
+#endif /* AMH_INNER_H_ */
diff --git a/TAO/DevGuideExamples/AMH_AMI/inner_server.cpp b/TAO/DevGuideExamples/AMH_AMI/inner_server.cpp
new file mode 100644
index 00000000000..6dd9f551f27
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/inner_server.cpp
@@ -0,0 +1,67 @@
+#include "amh_ami_pch.h"
+
+#include "inner_i.h"
+#include "ace/SString.h"
+#include "ace/OS_String.h"
+#include <iostream>
+#include <fstream>
+
+int dont_crash = 1;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ int c = 0;
+ while (c < argc)
+ {
+ if (ACE_OS::strcasecmp (argv[c], ACE_TEXT("-crash")) == 0)
+ dont_crash = 0;
+ c++;
+ }
+
+ return 1;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ parse_args (argc, argv);
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Inner_i servant(dont_crash);
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid = poa->activate_object( &servant );
+ obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( obj.in() );
+ ACE_CString iorname ("inner.ior");
+ std::ofstream iorFile (iorname.c_str());
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to " << iorname << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/middle.idl b/TAO/DevGuideExamples/AMH_AMI/middle.idl
new file mode 100644
index 00000000000..eb15857ba67
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/middle.idl
@@ -0,0 +1,6 @@
+// file: middle.idl
+
+interface Middle
+{
+ string get_the_answer (in string question);
+};
diff --git a/TAO/DevGuideExamples/AMH_AMI/middle_i.cpp b/TAO/DevGuideExamples/AMH_AMI/middle_i.cpp
new file mode 100644
index 00000000000..2b9d192bfcd
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/middle_i.cpp
@@ -0,0 +1,59 @@
+#include "amh_ami_pch.h"
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "middle_i.h"
+#include "inner_cb.h"
+
+#include <iostream>
+// Implementation skeleton constructor
+Asynch_Middle_i::Asynch_Middle_i (PortableServer::POA_ptr poa,
+ Inner_ptr inner)
+ : poa_ (PortableServer::POA::_duplicate(poa)),
+ inner_ (Inner::_duplicate(inner))
+{
+}
+
+void
+Asynch_Middle_i::get_the_answer (AMH_MiddleResponseHandler_ptr _tao_rh,
+ const char * question)
+{
+ // The callback handler servant instance holds on to a reference to the
+ // AMH response handler. That way, it can forward the reply back to the
+ // originial client after getting the reply from the inner server.
+ PortableServer::ServantBase_var servant = new Inner_callback_i(this->poa_.in(),
+ _tao_rh);
+ PortableServer::ObjectId_var objid =
+ this->poa_->activate_object(servant.in());
+ CORBA::Object_var obj = this->poa_->id_to_reference (objid.in());
+
+ AMI_InnerHandler_var cb = AMI_InnerHandler::_narrow(obj.in());
+
+ // forward the request on to the inner server, with the callback handler
+ // reference.
+ this->inner_->sendc_answer (cb.in(),question);
+
+ // nothing else to do. Our client will block until the callback handler
+ // forwards the reply.
+}
+
+
+//------------------------------------------------------------------------
+
+// Implementation skeleton constructor
+Middle_i::Middle_i (Inner_ptr inner)
+ : inner_ (Inner::_duplicate(inner))
+{
+}
+
+char *
+Middle_i::get_the_answer ( const char * question )
+{
+ return inner_->answer (question);
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/middle_i.h b/TAO/DevGuideExamples/AMH_AMI/middle_i.h
new file mode 100644
index 00000000000..1574d91e4f1
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/middle_i.h
@@ -0,0 +1,46 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MIDDLE_I_H_
+#define MIDDLE_I_H_
+
+#include "middleS.h"
+#include "innerC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Asynch_Middle_i : public virtual POA_AMH_Middle,
+ public virtual PortableServer::RefCountServantBase
+{
+public:
+ //Constructor
+ Asynch_Middle_i (PortableServer::POA_ptr poa, Inner_ptr inner);
+
+ virtual void get_the_answer (AMH_MiddleResponseHandler_ptr _tao_rh,
+ const char * question);
+
+private:
+ PortableServer::POA_var poa_;
+ Inner_var inner_;
+};
+
+// This version of the implementation does not use AMH, It is supplied for
+// comparison. Either this or the asynch version may be used to serve
+// "Middle" objects.
+class Middle_i : public virtual POA_Middle,
+ public virtual PortableServer::RefCountServantBase
+{
+public:
+ //Constructor
+ Middle_i (Inner_ptr inner);
+
+ virtual char * get_the_answer (const char * question);
+
+private:
+ PortableServer::POA_var poa_;
+ Inner_var inner_;
+};
+
+
+#endif /* MIDDLE_I_H_ */
diff --git a/TAO/DevGuideExamples/AMH_AMI/middle_server.cpp b/TAO/DevGuideExamples/AMH_AMI/middle_server.cpp
new file mode 100644
index 00000000000..9e0fd150481
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/middle_server.cpp
@@ -0,0 +1,81 @@
+#include "amh_ami_pch.h"
+
+#include "middle_i.h"
+#include <ace/OS_String.h>
+#include <iostream>
+#include <fstream>
+
+int use_synch = 0;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ int c = 0;
+ while (c < argc)
+ {
+ if (ACE_OS::strcasecmp (argv[c], "-no_AMH") == 0)
+ use_synch = 1;
+ c++;
+ }
+
+ return 1;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ parse_args(argc,argv);
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ obj = orb->string_to_object("file://inner.ior");
+ Inner_var peer =
+ Inner::_narrow(obj.in());
+ if (CORBA::is_nil(peer.in()))
+ {
+ std::cerr << "Could not initialize peer object reference" << std::endl;
+ exit (1);
+ }
+
+ // create either a synchronous or AMH_based servant depending on command
+ // line arguement.
+ PortableServer::ServantBase_var servant;
+ if (use_synch)
+ servant = new Middle_i (peer.in());
+ else
+ servant = new Asynch_Middle_i(poa.in(), peer.in());
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid = poa->activate_object(servant.in());
+ obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( obj.in() );
+
+ ACE_CString iorname("middle.ior");
+ std::ofstream iorFile (iorname.c_str());
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to " << iorname << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/AMH_AMI/run_test.pl b/TAO/DevGuideExamples/AMH_AMI/run_test.pl
new file mode 100644
index 00000000000..8e704213c77
--- /dev/null
+++ b/TAO/DevGuideExamples/AMH_AMI/run_test.pl
@@ -0,0 +1,58 @@
+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;
+
+$inner_ior = PerlACE::LocalFile ("inner.ior");
+$middle_ior = PerlACE::LocalFile ("middle.ior");
+unlink $inner_ior;
+unlink $middle_ior;
+
+# start inner_server
+
+$IS = new PerlACE::Process("inner_server");
+$IS->Spawn();
+
+if (PerlACE::waitforfile_timed ($inner_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$inner_ior>\n";
+ $IS->Kill();
+ unlink $inner_ior;
+ exit 1;
+}
+
+
+# start middle_server
+
+$MS = new PerlACE::Process("middle_server");
+$MS->Spawn();
+
+if (PerlACE::waitforfile_timed ($middle_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$middle_ior>\n";
+ $MS->Kill();
+ unlink $middle_ior;
+ exit 1;
+}
+
+# start client
+
+$C = new PerlACE::Process("client");
+$C->Spawn();
+
+$CRET = $C->WaitKill(25);
+$IS->Kill();
+$MS->Kill();
+
+# clean-up
+
+unlink $inner_ior;
+unlink $middle_ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/BiDirectionalGIOP.mpc b/TAO/DevGuideExamples/BiDirectionalGIOP/BiDirectionalGIOP.mpc
new file mode 100644
index 00000000000..d75d57f1c56
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/BiDirectionalGIOP.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, avoids_minimum_corba, bidir_giop, avoids_corba_e_micro {
+ exename = server
+ idlflags += -Wb,pch_include=bidir_giop_pch.h
+ Source_Files {
+ callbackC.cpp
+ simpleC.cpp
+ simpleS.cpp
+ simple_i.cpp
+ server.cpp
+ }
+}
+
+project(*Client): taoexe, portableserver, avoids_minimum_corba, bidir_giop, avoids_corba_e_micro {
+ exename = client
+ idlflags += -Wb,pch_include=bidir_giop_pch.h
+ Source_Files {
+ simpleC.cpp
+ callbackC.cpp
+ callbackS.cpp
+ callback_i.cpp
+ client.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/README b/TAO/DevGuideExamples/BiDirectionalGIOP/README
new file mode 100644
index 00000000000..6314e1cd301
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/README
@@ -0,0 +1,27 @@
+This example is a copy of the $TAO_ROOT/test/BiDirerectional test
+but it does not use ACE_TRY/ENVIRONMENT macros.
+
+This example exercises the birectional GIOP connection
+implementation in TAO.
+
+Start like this:
+
+$ server -o <file.ior> -i <no_iterations>
+$ client -k file://<file.ior>
+
+The server starts up writing the IOR to the file. The client then
+starts up, creates its own object and passes the reference to the
+server. Then it invokes a method on the server to indicate that it is
+ready for callback. The server then callsback the client on the same
+connection <no_iterations> times. If the server creates a new
+connection the server will crash itself.
+
+Each time the client recieves a callback, it outputs:
+Callback method called.
+
+
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.cpp b/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.cpp
new file mode 100644
index 00000000000..570337d5803
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.cpp
@@ -0,0 +1 @@
+#include "bidir_giop_pch.h"
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.h b/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.h
new file mode 100644
index 00000000000..cc3b7dd664f
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/bidir_giop_pch.h
@@ -0,0 +1,15 @@
+#ifndef BIDIR_GIOP_PCH_H
+#define BIDIR_GIOP_PCH_H
+
+// See the Devguide chapter on Getting Started With Visual C++ for
+// more information on how to correctly use precompiled headers.
+// Currently only Windows VC++ defines USING_PCH so this file
+// is effectively empty for other platforms.
+
+#ifdef USING_PCH
+#include "tao/corba.h"
+#include "tao/ORB_Core.h"
+#include "tao/Stub.h"
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/callback.idl b/TAO/DevGuideExamples/BiDirectionalGIOP/callback.idl
new file mode 100644
index 00000000000..ddb989750a2
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/callback.idl
@@ -0,0 +1,10 @@
+interface Callback
+{
+ // A safe way to shutdown the client, using either clean shutdowns
+ // or "catastrophic failures".
+ oneway void shutdown();
+
+ // A simple remote call
+ void callback_method();
+};
+
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.cpp b/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.cpp
new file mode 100644
index 00000000000..cc4d9d3977b
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.cpp
@@ -0,0 +1,26 @@
+#include "bidir_giop_pch.h"
+
+#include "callback_i.h"
+#include <iostream>
+
+Callback_i::Callback_i (CORBA::ORB_ptr orb)
+: orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+Callback_i::~Callback_i (void)
+{
+}
+
+void Callback_i::shutdown ()
+{
+ std::cout << "Performing clean shutdown." << std::endl;
+ const int wait = 0;
+ orb_->shutdown(wait);
+}
+
+void Callback_i::callback_method ()
+{
+ std::cout << "Callback method called." << std::endl;
+}
+
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.h b/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.h
new file mode 100644
index 00000000000..dc70a79ed39
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/callback_i.h
@@ -0,0 +1,22 @@
+#ifndef CALLBACKI_H_
+#define CALLBACKI_H_
+
+#include "callbackS.h"
+
+class Callback_i : public virtual POA_Callback
+{
+public:
+ Callback_i (CORBA::ORB_ptr orb);
+
+ virtual ~Callback_i (void);
+
+ virtual void shutdown (void);
+
+ virtual void callback_method (void);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+
+#endif /* CALLBACKI_H_ */
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/client.cpp b/TAO/DevGuideExamples/BiDirectionalGIOP/client.cpp
new file mode 100644
index 00000000000..d935c5e1b5e
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/client.cpp
@@ -0,0 +1,101 @@
+#include "bidir_giop_pch.h"
+
+#include "callback_i.h"
+#include "simpleC.h"
+
+#include <ace/Get_Opt.h>
+#include <ace/Argv_Type_Converter.h>
+#include <tao/BiDir_GIOP/BiDirGIOP.h>
+
+#include <iostream>
+
+ACE_TString ior = ACE_TEXT ("file://test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("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 <ior>" << std::endl;
+ return -1;
+ break;
+ }
+ return 0;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+
+ if (parse_args (argc, argv) != 0) {
+ return 1;
+ }
+
+ try {
+ ACE_Argv_Type_Converter conv(argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init(conv.get_argc(),
+ conv.get_TCHAR_argv (), "");
+
+ // Create a bidirectional POA
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var poa_manager = root_poa->the_POAManager();
+ // Policies for the childPOA to be created.
+ CORBA::PolicyList policies(1);
+ policies.length(1);
+ CORBA::Any pol;
+ pol <<= BiDirPolicy::BOTH;
+ policies[0] =
+ orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, pol);
+ // Create POA as child of RootPOA with the above policies. This POA
+ // will receive request in the same connection in which it sent
+ // the request
+ PortableServer::POA_var poa = root_poa->create_POA("bidirPOA", poa_manager.in(), policies);
+ // Creation of bidirPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i) {
+ policies[i]->destroy ();
+ }
+ poa_manager->activate ();
+
+ // get server object
+ obj = orb->string_to_object(ACE_TEXT_ALWAYS_CHAR(ior.c_str()));
+ Simple_var server = Simple::_narrow (obj.in());
+
+ Callback_i callback_svt(orb.in());
+
+ // Register and activate callback servant
+ PortableServer::ObjectId_var id = poa->activate_object(&callback_svt);
+ obj = poa->id_to_reference(id.in());
+ Callback_var callback = Callback::_narrow(obj.in());
+
+ server->callback_object (callback.in());
+
+ CORBA::Long r = server->test_method(1); // Tell the server to call us back.
+ if (r != 0) {
+ std::cout << "unexpected result = " << r << std::endl;
+ }
+
+ orb->run();
+
+ int etherealize = 1, wait = 1;
+ poa->destroy(etherealize, wait);
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught CORBA::Exception: " << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl b/TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl
new file mode 100644
index 00000000000..f126f2865ef
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl
@@ -0,0 +1,39 @@
+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;
+
+$iorfile = "test.ior";
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-o $iorfile -i 100");
+$CL = new PerlACE::Process ("client", "-k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$status = 0;
+
+$client = $CL->SpawnWaitKill (15);
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (5);
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/server.cpp b/TAO/DevGuideExamples/BiDirectionalGIOP/server.cpp
new file mode 100644
index 00000000000..a9af3367bfa
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/server.cpp
@@ -0,0 +1,115 @@
+#include "bidir_giop_pch.h"
+
+#include "simple_i.h"
+#include "callbackC.h"
+
+#include <ace/Get_Opt.h>
+#include <ace/Argv_Type_Converter.h>
+#include <tao/BiDir_GIOP/BiDirGIOP.h>
+#include <iostream>
+#include <fstream>
+
+ACE_TString ior_output_file;
+int callback_count = 10;
+
+int
+parse_args(int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts(argc, argv, ACE_TEXT("o:i:"));
+ int c;
+
+ while((c = get_opts()) != -1)
+ switch(c)
+ {
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+ case 'i':
+ callback_count = ACE_OS::atoi(get_opts.optarg);
+ break;
+ case '?':
+ default:
+ std::cerr << "usage: " << argv[0] << "-o <iorfile> -i <no_iterations>" << std::endl;
+ return -1;
+ break;
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ if (parse_args(argc, argv) != 0) {
+ return 1;
+ }
+
+ try
+ {
+ ACE_Argv_Type_Converter conv(argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init(conv.get_argc(),
+ conv.get_TCHAR_argv(), "");
+
+ // Create a bidirectional POA
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var poa_manager = root_poa->the_POAManager();
+ // Policies for the childPOA to be created.
+ CORBA::PolicyList policies(1);
+ policies.length(1);
+ CORBA::Any pol;
+ pol <<= BiDirPolicy::BOTH;
+ policies[0] =
+ orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, pol);
+ // Create POA as child of RootPOA with the above policies. This POA
+ // will receive request in the same connection in which it sent
+ // the request
+ PortableServer::POA_var poa = root_poa->create_POA("bidirPOA", poa_manager.in(), policies);
+ // Creation of bidirPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i) {
+ policies[i]->destroy ();
+ }
+ poa_manager->activate ();
+
+ Simple_i svt(orb.in(), callback_count);
+
+ // Register and activate Simple servant
+ PortableServer::ObjectId_var id = poa->activate_object(&svt);
+ obj = poa->id_to_reference(id.in());
+ Simple_var server = Simple::_narrow(obj.in());
+
+ CORBA::String_var ior = orb->object_to_string(server.in());
+ if (ior_output_file != ACE_TEXT("")) {
+ std::ofstream outfile(ACE_TEXT_ALWAYS_CHAR(ior_output_file.c_str()));
+ outfile << ior.in();
+ }
+ std::cout << "Activated as " << ior.in() << std::endl;
+
+ // Our own special orb->run() that knows how to callback clients
+ while (true) {
+
+ // returns 1 as soon as it has successfully called back.
+ if (svt.call_client()) {
+ break;
+ }
+
+ // We don't want to check for work pending, because we really want
+ // to simulate a normal orb->run() while adding the ability to call
+ // our routine which calls back to the client.
+ orb->perform_work();
+ }
+
+ std::cout << "Event loop finished." << std::endl;
+
+ int etherealize = 1, wait = 1;
+ poa->destroy(etherealize, wait);
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught CORBA::Exception: " << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/simple.idl b/TAO/DevGuideExamples/BiDirectionalGIOP/simple.idl
new file mode 100644
index 00000000000..e6ef4fffa86
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/simple.idl
@@ -0,0 +1,14 @@
+#include "callback.idl"
+
+interface Simple
+{
+ // Just call a method on the server,
+ long test_method(in boolean do_callback);
+
+ // send the callback object to the server
+ void callback_object(in Callback cb);
+
+ // A safe way to shutdown the server, it is a oneway function so we
+ // will never get a COMM_FAILURE error
+ oneway void shutdown();
+};
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.cpp b/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.cpp
new file mode 100644
index 00000000000..be05be761e9
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.cpp
@@ -0,0 +1,77 @@
+#include "bidir_giop_pch.h"
+
+#include "simple_i.h"
+
+#include <tao/ORB_Core.h>
+#include <tao/Transport_Cache_Manager.h>
+#include <tao/Thread_Lane_Resources.h>
+
+#include <iostream>
+
+Simple_i::Simple_i (CORBA::ORB_ptr orb, int callback_count)
+: orb_(CORBA::ORB::_duplicate(orb))
+, ready_for_callback_(0)
+, callback_count_(callback_count)
+, callback_(0)
+{
+}
+
+Simple_i::~Simple_i (void)
+{
+}
+
+CORBA::Long Simple_i::test_method (CORBA::Boolean do_callback)
+ACE_THROW_SPEC ((
+ CORBA::SystemException
+))
+{
+ if (do_callback) {
+ ready_for_callback_ = 1;
+ }
+ return 0;
+}
+
+void Simple_i::callback_object (Callback_ptr cb)
+ACE_THROW_SPEC ((
+ CORBA::SystemException
+))
+{
+ callback_ = Callback::_duplicate(cb);
+}
+
+void Simple_i::shutdown ()
+ACE_THROW_SPEC ((
+ CORBA::SystemException
+))
+{
+ const int wait = 0;
+ orb_->shutdown(wait);
+}
+
+int
+Simple_i::call_client()
+{
+ if (ready_for_callback_) {
+
+ ready_for_callback_ = 0;
+
+ for (int times = 0; times < callback_count_; ++times) {
+
+ callback_->callback_method();
+
+ if (orb_->orb_core()->lane_resources().transport_cache().current_size() > 1)
+ {
+ std::cerr << "The connection cache has grown. "
+ << "BiDirection did not work. aborting..." << std::endl;
+ ACE_OS::abort(); // Should probably define and throw a UserException
+ }
+ }
+
+ callback_->shutdown();
+
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.h b/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.h
new file mode 100644
index 00000000000..feb107e351f
--- /dev/null
+++ b/TAO/DevGuideExamples/BiDirectionalGIOP/simple_i.h
@@ -0,0 +1,46 @@
+#ifndef SIMPLEI_H_
+#define SIMPLEI_H_
+
+#include "simpleS.h"
+
+class Simple_i : public virtual POA_Simple
+{
+public:
+ Simple_i (CORBA::ORB_ptr orb, int iterations);
+
+ virtual ~Simple_i (void);
+
+virtual CORBA::Long test_method (
+ CORBA::Boolean do_callback
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+virtual void callback_object (
+ Callback_ptr cb
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+virtual void shutdown (
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Not part of the CORBA interface. This method is called
+ /// by our special orb event loop in server main().
+ int call_client();
+
+private:
+ CORBA::ORB_var orb_;
+ int ready_for_callback_;
+ int callback_count_;
+ Callback_var callback_;
+};
+
+
+#endif /* SIMPLEI_H_ */
diff --git a/TAO/DevGuideExamples/CIAO/CIAO.mwc b/TAO/DevGuideExamples/CIAO/CIAO.mwc
new file mode 100644
index 00000000000..d90104a2381
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/CIAO.mwc
@@ -0,0 +1,2 @@
+workspace {
+}
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator.cidl b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.cidl
new file mode 100644
index 00000000000..0d6f1f9fd97
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.cidl
@@ -0,0 +1,22 @@
+/**
+ * @file Administrator.cidl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#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/TAO/DevGuideExamples/CIAO/Messenger/Administrator.idl b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.idl
new file mode 100644
index 00000000000..ee67ebfb5ff
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.idl
@@ -0,0 +1,22 @@
+/**
+ * @file Administrator.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef ADMINISTRATOR_IDL
+#define ADMINISTRATOR_IDL
+
+#include <Components.idl>
+#include <Runnable.idl>
+#include <Publication.idl>
+
+component Administrator {
+ uses multiple Runnable runnables;
+ uses multiple Publication content;
+};
+
+home AdministratorHome manages Administrator {};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator.mpc b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.mpc
new file mode 100644
index 00000000000..1921aa4e0a9
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator.mpc
@@ -0,0 +1,96 @@
+//
+// @file Administrator.mpc
+//
+// @author Don Busch <busch_d@ociweb.com>
+//
+
+project(Administrator_idl): ciao_client_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,stub_export_macro=ADMINISTRATOR_STUB_Export
+ idlflags += -Wb,stub_export_include=Administrator_stub_export.h
+ idlflags += -Wb,skel_export_macro=ADMINISTRATOR_SVNT_Export
+ idlflags += -Wb,skel_export_include=Administrator_svnt_export.h
+
+ IDL_Files {
+ Administrator.idl
+ }
+}
+
+
+project(Administrator_stub): ciao_client_dnc {
+ requires += cidl
+
+ after += Messenger_stub Administrator_idl
+ sharedname = Administrator_stub
+ libs += Messenger_stub
+ dynamicflags = ADMINISTRATOR_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AdministratorC.cpp
+ }
+}
+
+project(Administrator_cidl): ciao_servant_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,export_macro=ADMINISTRATOR_SVNT_Export
+ idlflags += -Wb,export_include=Administrator_svnt_export.h
+
+ // cidlc does NOT automatically add the current directory to
+ // the include path. This is a worksround to add it. We have
+ // to insert it before the "--" that is at the end of the
+ // default cidlflags.
+ cidlflags -= --
+ cidlflags += -I. --
+
+ // project must be a ciao_servant or ciao_server to use CIDL files
+ CIDL_Files {
+ Administrator.cidl
+ }
+
+ IDL_Files {
+ AdministratorE.idl
+ }
+}
+
+project(Administrator_svnt): ciao_servant_dnc {
+ requires += cidl
+ after += Administrator_cidl Administrator_stub
+ sharedname = Administrator_svnt
+ libs += Administrator_stub Messenger_stub
+ dynamicflags = ADMINISTRATOR_SVNT_BUILD_DLL
+
+ Source_Files {
+ AdministratorS.cpp
+ AdministratorEC.cpp
+ Administrator_svnt.cpp
+ }
+ CIDL_Files {
+ }
+ IDL_Files {
+ }
+}
+
+project(Administrator_exec): ciao_component_dnc {
+ requires += cidl
+
+ after += Administrator_svnt
+ sharedname = Administrator_exec
+ libs += Administrator_stub Administrator_svnt Messenger_stub
+ dynamicflags = ADMINISTRATOR_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AdministratorES.cpp
+ Administrator_exec_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client.cpp
new file mode 100644
index 00000000000..2fdd28af3ab
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client.cpp
@@ -0,0 +1,121 @@
+/**
+ * @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 <busch_d@ociweb.com>
+ */
+
+#include "ace/Get_Opt.h"
+#include <iostream>
+
+const char* ior = "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 <ior>" << 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
+main (int argc, char *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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.cpp
new file mode 100644
index 00000000000..f3c508a50ef
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.cpp
@@ -0,0 +1,8 @@
+/**
+ * @file Administrator_Client_IDL2.cpp
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#include "idl2/Messenger_IDL2C.h"
+#include "Administrator_Client.cpp"
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.mpc b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.mpc
new file mode 100644
index 00000000000..4ee650af0de
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL2.mpc
@@ -0,0 +1,45 @@
+project(Administrator_Client_IDL2_Compile): taoidl3toidl2defaults {
+ requires += cidl
+ // 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): ciao_client_dnc, valuetype {
+ requires += cidl
+ 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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.cpp
new file mode 100644
index 00000000000..5dd6316f986
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.cpp
@@ -0,0 +1,8 @@
+/**
+ * @file Administrator_Client_IDL3.cpp
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#include "MessengerC.h"
+#include "Administrator_Client.cpp"
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.mpc b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.mpc
new file mode 100644
index 00000000000..045b2dd2d88
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_Client_IDL3.mpc
@@ -0,0 +1,29 @@
+//
+// @file Administrator_Client_IDL3.mpc
+//
+// @author Don Busch <busch_d@ociweb.com>
+//
+
+project(Administrator_Client_IDL3): ciao_client_dnc, valuetype, {
+ requires += cidl
+ after += Messenger_stub
+ libs += Messenger_stub
+
+ 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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_export.h
new file mode 100644
index 00000000000..e90abc0929b
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.cpp
new file mode 100644
index 00000000000..e99433bda39
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.cpp
@@ -0,0 +1,278 @@
+// $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 <iostream>
+#include <string>
+
+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)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ this->context_ =
+ Administrator_Context::_narrow (
+ ctx);
+
+ if (this->context_ == 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Administrator_exec_i::ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+
+ // MY CODE
+ ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_passivate\n" )));
+ }
+
+ void
+ Administrator_exec_i::ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_remove\n")));
+ }
+
+ void
+ Administrator_exec_i::ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("ciao_preactivate\n")));
+ }
+
+ void
+ Administrator_exec_i::ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("ciao_postactivate\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 );
+ }
+ }
+
+ //==================================================================
+ // 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ ::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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.h
new file mode 100644
index 00000000000..69271a63266
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_exec_i.h
@@ -0,0 +1,138 @@
+// $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 "Administrator_svnt.h"
+#include "Administrator_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include <ace/Task.h>
+
+namespace CIDL_Administrator_Impl
+{
+ class ADMINISTRATOR_EXEC_Export Administrator_exec_i
+ : public virtual Administrator_Exec,
+ public virtual ACE_Task_Base,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ 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)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_passivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ protected:
+ Administrator_Context *context_;
+
+ public:
+ // Overridden from ACE_Task_Base
+ int svc();
+
+ private:
+ void startPublishing();
+ void stopPublishing();
+ void changePublicationPeriod();
+ void changePublicationText();
+ };
+
+ class ADMINISTRATOR_EXEC_Export AdministratorHome_exec_i
+ : public virtual AdministratorHome_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+ };
+
+ extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_AdministratorHome_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_ADMINISTRATOR_EXEC_H */
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Administrator_stub_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_stub_export.h
new file mode 100644
index 00000000000..d5f9dcc7d86
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_stub_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Administrator_svnt_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_svnt_export.h
new file mode 100644
index 00000000000..e6cdc5c687e
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Administrator_svnt_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/History.idl b/TAO/DevGuideExamples/CIAO/Messenger/History.idl
new file mode 100644
index 00000000000..c690bce9ed5
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/History.idl
@@ -0,0 +1,17 @@
+/**
+ * @file History.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef HISTORY_IDL
+#define HISTORY_IDL
+
+#include <Message.idl>
+
+interface History {
+ Messages get_all();
+ Message get_latest();
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.cpp
new file mode 100644
index 00000000000..e964e12f455
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.cpp
@@ -0,0 +1,100 @@
+// $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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException))
+ {
+ // Your code here.
+
+ // MY CODE
+ ACE_Guard<ACE_Mutex> 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException))
+ {
+ // Your code here.
+
+ // MY CODE
+ ACE_Guard<ACE_Mutex> 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<ACE_Mutex> 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/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.h
new file mode 100644
index 00000000000..6e100e29a90
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/History_exec_i.h
@@ -0,0 +1,76 @@
+// $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 "Messenger_svnt.h"
+#include "Messenger_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+// MY CODE
+#include <list>
+#include <ace/Synch.h>
+
+namespace CIDL_Messenger_Impl
+{
+ class MESSENGER_EXEC_Export History_exec_i
+ : public virtual ::CCM_History,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ History_exec_i (void);
+ virtual ~History_exec_i (void);
+
+ // Operations from ::History
+
+ virtual ::Messages *
+ get_all ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException));
+
+ virtual ::Message *
+ get_latest ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException));
+
+ // 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/TAO/DevGuideExamples/CIAO/Messenger/Message.idl b/TAO/DevGuideExamples/CIAO/Messenger/Message.idl
new file mode 100644
index 00000000000..02fe99f5f3d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Message.idl
@@ -0,0 +1,19 @@
+/**
+ * @file Message.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef MESSAGE_IDL
+#define MESSAGE_IDL
+
+#include <Components.idl>
+
+eventtype Message {
+ public string subject;
+ public string user;
+ public string text;
+};
+typedef sequence<Message> Messages;
+
+#endif
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Messenger.cidl b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.cidl
new file mode 100644
index 00000000000..7642335f1a0
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.cidl
@@ -0,0 +1,22 @@
+/**
+ * @file Messenger.cidl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#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/TAO/DevGuideExamples/CIAO/Messenger/Messenger.idl b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.idl
new file mode 100644
index 00000000000..3c9633da8a7
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.idl
@@ -0,0 +1,28 @@
+/**
+ * @file Messenger.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef MESSENGER_IDL
+#define MESSENGER_IDL
+
+#include <Components.idl>
+#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/TAO/DevGuideExamples/CIAO/Messenger/Messenger.mpc b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.mpc
new file mode 100644
index 00000000000..7514f41b29f
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger.mpc
@@ -0,0 +1,109 @@
+//
+// @file Messenger.mpc
+//
+// @author Don Busch <busch_d@ociweb.com>
+//
+
+project(Messenger_idl): ciao_client_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export
+ idlflags += -Wb,stub_export_include=Messenger_stub_export.h
+ idlflags += -Wb,skel_export_macro=MESSENGER_SVNT_Export
+ idlflags += -Wb,skel_export_include=Messenger_svnt_export.h
+
+ IDL_Files {
+ Runnable.idl
+ Publication.idl
+ Message.idl
+ History.idl
+ Messenger.idl
+ }
+}
+
+project(Messenger_stub): ciao_client_dnc {
+ requires += cidl
+ after += Messenger_idl
+ sharedname = Messenger_stub
+ dynamicflags = MESSENGER_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ RunnableC.cpp
+ PublicationC.cpp
+ MessageC.cpp
+ HistoryC.cpp
+ MessengerC.cpp
+ }
+}
+
+project(Messenger_cidl): ciao_servant_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,export_macro=MESSENGER_SVNT_Export
+ idlflags += -Wb,export_include=Messenger_svnt_export.h
+
+ // cidlc does NOT automatically add the current directory to
+ // the include path. This is a worksround to add it. We have
+ // to insert it before the "--" that is at the end of the
+ // default cidlflags.
+ cidlflags -= --
+ cidlflags += -I. --
+
+ // project must be a ciao_servant or ciao_server to use CIDL files
+ CIDL_Files {
+ Messenger.cidl
+ }
+
+ IDL_Files {
+ MessengerE.idl
+ }
+}
+
+project(Messenger_svnt): ciao_servant_dnc {
+ requires += cidl
+ after += Messenger_cidl Messenger_stub
+ sharedname = Messenger_svnt
+ libs += Messenger_stub
+ dynamicflags = MESSENGER_SVNT_BUILD_DLL
+
+ Source_Files {
+ RunnableS.cpp
+ PublicationS.cpp
+ MessageS.cpp
+ HistoryS.cpp
+ MessengerS.cpp
+ MessengerEC.cpp
+ Messenger_svnt.cpp
+ }
+
+ CIDL_Files {
+ }
+ IDL_Files {
+ }
+}
+
+project(Messenger_exec): ciao_component_dnc {
+ requires += cidl
+
+ after += Messenger_svnt
+ sharedname = Messenger_exec
+ libs += Messenger_stub Messenger_svnt
+ dynamicflags = MESSENGER_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ MessengerES.cpp
+ Messenger_exec_i.cpp
+ Publication_exec_i.cpp
+ History_exec_i.cpp
+ Runnable_exec_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_export.h
new file mode 100644
index 00000000000..4b3a125c287
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.cpp
new file mode 100644
index 00000000000..0520e7bc2f3
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.cpp
@@ -0,0 +1,273 @@
+// $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<ACE_Mutex> 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 ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return CORBA::string_dup( this->subject_.c_str() );
+ }
+
+ void
+ Messenger_exec_i::subject ( const char* subject)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ this->subject_ = CORBA::string_dup( subject );
+ }
+
+ // Port operations.
+
+ ::CCM_Publication_ptr
+ Messenger_exec_i::get_content ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // 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_Runnable_ptr
+ Messenger_exec_i::get_control ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // 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_History_ptr
+ Messenger_exec_i::get_message_history ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // 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)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ this->context_ =
+ Messenger_Context::_narrow (
+ ctx);
+
+ if (this->context_ == 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Messenger_exec_i::ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ }
+
+ void
+ Messenger_exec_i::ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ }
+
+ void
+ Messenger_exec_i::ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_activate\n")));
+ this->activate();
+ }
+
+ void
+ Messenger_exec_i::ccm_passivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_passivate\n")));
+ }
+
+ void
+ Messenger_exec_i::ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_remove\n")));
+ }
+
+ //==================================================================
+ // 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ ::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/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.h
new file mode 100644
index 00000000000..218d006301b
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_exec_i.h
@@ -0,0 +1,167 @@
+// $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 "Messenger_svnt.h"
+#include "Messenger_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+// MY CODE
+#include <string>
+#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 TAO_Local_RefCounted_Object,
+ public virtual ACE_Task_Base
+ {
+ public:
+ Messenger_exec_i (void);
+ virtual ~Messenger_exec_i (void);
+
+ // Supported or inherited operations.
+
+ // Operations from ::Runnable
+
+ // Attribute operations.
+
+ virtual char * subject ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void subject (const char* subject)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Port operations.
+
+ virtual ::CCM_Publication_ptr
+ get_content ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CCM_Runnable_ptr
+ get_control ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CCM_History_ptr
+ get_message_history ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Operations from Components::SessionComponent
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_passivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ // MY CODE
+ virtual int svc();
+
+ protected:
+ Messenger_Context *context_;
+
+ // MY CODE
+ private:
+ Runnable_exec_i* control_;
+ Publication_exec_i* content_;
+ History_exec_i* history_;
+
+ std::string subject_;
+ const std::string user_;
+ };
+
+ class MESSENGER_EXEC_Export MessengerHome_exec_i
+ : public virtual MessengerHome_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+ };
+
+ extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_MessengerHome_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_MESSENGER_EXEC_H */
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Messenger_stub_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_stub_export.h
new file mode 100644
index 00000000000..9f866bac3fd
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_stub_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Messenger_svnt_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_svnt_export.h
new file mode 100644
index 00000000000..4415ac291d2
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Messenger_svnt_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Publication.idl b/TAO/DevGuideExamples/CIAO/Messenger/Publication.idl
new file mode 100644
index 00000000000..947e596ef50
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Publication.idl
@@ -0,0 +1,15 @@
+/**
+ * @file Publication.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef PUBLICATION_IDL
+#define PUBLICATION_IDL
+
+interface Publication {
+ attribute string text;
+ attribute unsigned short period;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.cpp
new file mode 100644
index 00000000000..a12ada2d355
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.cpp
@@ -0,0 +1,89 @@
+// $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_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_Guard<ACE_Mutex> guard(this->lock_);
+
+ return CORBA::string_dup( this->text_.c_str() );
+ }
+
+ void
+ Publication_exec_i::text (
+ const char* text)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_Guard<ACE_Mutex> 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_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_Guard<ACE_Mutex> guard(this->lock_);
+
+ return this->period_;
+ }
+
+ void
+ Publication_exec_i::period (
+ CORBA::UShort period)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_Guard<ACE_Mutex> 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/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.h
new file mode 100644
index 00000000000..7cb75471279
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Publication_exec_i.h
@@ -0,0 +1,79 @@
+// $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 "Messenger_svnt.h"
+#include "Messenger_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+// MY CODE
+#include <string>
+#include <ace/Synch.h>
+
+namespace CIDL_Messenger_Impl
+{
+ class MESSENGER_EXEC_Export Publication_exec_i
+ : public virtual ::CCM_Publication,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ Publication_exec_i ( const char* text,
+ CORBA::UShort period );
+ virtual ~Publication_exec_i (void);
+
+ // Operations from ::Publication
+
+ virtual char*
+ text ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void
+ text ( const char* text)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::UShort
+ period ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void
+ period ( CORBA::UShort period)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ std::string text_;
+ CORBA::UShort period_;
+
+ ACE_Mutex lock_;
+ };
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_PUBLICATION_EXEC_H */
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Receiver.cidl b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.cidl
new file mode 100644
index 00000000000..7fc893c080f
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.cidl
@@ -0,0 +1,21 @@
+/**
+ * @file Receiver.cidl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#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/TAO/DevGuideExamples/CIAO/Messenger/Receiver.idl b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.idl
new file mode 100644
index 00000000000..1b9717d326e
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.idl
@@ -0,0 +1,21 @@
+/**
+ * @file Receiver.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef RECEIVER_IDL
+#define RECEIVER_IDL
+
+#include <Components.idl>
+#include <Message.idl>
+#include <History.idl>
+
+component Receiver {
+ consumes Message message_consumer;
+ uses History message_history;
+};
+
+home ReceiverHome manages Receiver {};
+
+#endif
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Receiver.mpc b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.mpc
new file mode 100644
index 00000000000..280777d2c8a
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver.mpc
@@ -0,0 +1,96 @@
+//
+// @file Receiver.mpc
+//
+// @author Don Busch <busch_d@ociweb.com>
+//
+
+project(Receiver_idl): ciao_client_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export
+ idlflags += -Wb,stub_export_include=Receiver_stub_export.h
+ idlflags += -Wb,skel_export_macro=RECEIVER_SVNT_Export
+ idlflags += -Wb,skel_export_include=Receiver_svnt_export.h
+
+ IDL_Files {
+ Receiver.idl
+ }
+}
+
+project(Receiver_stub): ciao_client_dnc {
+ requires += cidl
+
+ after += Messenger_stub Receiver_idl
+ sharedname = Receiver_stub
+ libs += Messenger_stub
+ dynamicflags = RECEIVER_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ ReceiverC.cpp
+ }
+}
+
+project(Receiver_cidl): ciao_servant_dnc {
+ custom_only = 1
+ requires += cidl
+
+ idlflags += -Wb,export_macro=RECEIVER_SVNT_Export
+ idlflags += -Wb,export_include=Receiver_svnt_export.h
+
+ // cidlc does NOT automatically add the current directory to
+ // the include path. This is a worksround to add it. We have
+ // to insert it before the "--" that is at the end of the
+ // default cidlflags.
+ cidlflags -= --
+ cidlflags += -I. --
+
+ // project must be a ciao_servant or ciao_server to use CIDL files
+ CIDL_Files {
+ Receiver.cidl
+ }
+
+ IDL_Files {
+ ReceiverE.idl
+ }
+}
+
+project(Receiver_svnt): ciao_servant_dnc {
+ requires += cidl
+
+ after += Receiver_cidl Messenger_svnt Receiver_stub
+ sharedname = Receiver_svnt
+ libs += Receiver_stub Messenger_stub Messenger_svnt
+ dynamicflags = RECEIVER_SVNT_BUILD_DLL
+
+ Source_Files {
+ ReceiverS.cpp
+ ReceiverEC.cpp
+ Receiver_svnt.cpp
+ }
+
+ CIDL_Files {
+ }
+ IDL_Files {
+ }
+}
+
+project(Receiver_exec): ciao_component_dnc {
+ requires += cidl
+
+ after += Receiver_svnt
+ sharedname = Receiver_exec
+ libs += Receiver_stub Receiver_svnt Messenger_stub
+ dynamicflags = RECEIVER_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ ReceiverES.cpp
+ Receiver_exec_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_export.h
new file mode 100644
index 00000000000..8ad3640d130
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.cpp
new file mode 100644
index 00000000000..b08db1cef52
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.cpp
@@ -0,0 +1,196 @@
+// $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)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // 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)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ this->context_ =
+ Receiver_Context::_narrow (
+ ctx);
+
+ if (this->context_ == 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Receiver_exec_i::ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_activate\n")));
+ }
+
+ void
+ Receiver_exec_i::ccm_passivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_passivate\n")));
+ }
+
+ void
+ Receiver_exec_i::ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_remove\n")));
+ }
+
+ void
+ Receiver_exec_i::ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ciao_preactivate\n")));
+ }
+
+ void
+ Receiver_exec_i::ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ // Your code here.
+ ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ciao_postactivate\n")));
+ }
+
+ //==================================================================
+ // 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException))
+ {
+ ::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/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.h
new file mode 100644
index 00000000000..5ccb8fb402d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_exec_i.h
@@ -0,0 +1,131 @@
+// $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 "Receiver_svnt.h"
+#include "Receiver_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+namespace CIDL_Receiver_Impl
+{
+ class RECEIVER_EXEC_Export Receiver_exec_i
+ : public virtual Receiver_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ 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)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Operations from Components::SessionComponent
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_preactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ciao_postactivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_activate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_passivate ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ virtual void
+ ccm_remove ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+
+ protected:
+ Receiver_Context *context_;
+ };
+
+ class RECEIVER_EXEC_Export ReceiverHome_exec_i
+ : public virtual ReceiverHome_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ 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 ()
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException,
+ ::Components::CCMException));
+ };
+
+ extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_ReceiverHome_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_RECEIVER_EXEC_H */
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Receiver_stub_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_stub_export.h
new file mode 100644
index 00000000000..c457802854f
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_stub_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Receiver_svnt_export.h b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_svnt_export.h
new file mode 100644
index 00000000000..1c9eca2556d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Receiver_svnt_export.h
@@ -0,0 +1,54 @@
+
+// -*- 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 (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/TAO/DevGuideExamples/CIAO/Messenger/Runnable.idl b/TAO/DevGuideExamples/CIAO/Messenger/Runnable.idl
new file mode 100644
index 00000000000..7b006bca89b
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Runnable.idl
@@ -0,0 +1,15 @@
+/**
+ * @file Runnable.idl
+ *
+ * @author Don Busch <busch_d@ociweb.com>
+ */
+
+#ifndef RUNNABLE_IDL
+#define RUNNABLE_IDL
+
+interface Runnable {
+ void start();
+ void stop();
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.cpp b/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.cpp
new file mode 100644
index 00000000000..12ba03b4c8b
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.cpp
@@ -0,0 +1,63 @@
+// $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 ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ this->run_lock_.release();
+ }
+
+ void
+ Runnable_exec_i::stop ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ this->run_lock_.acquire();
+ }
+
+ ACE_Mutex&
+ Runnable_exec_i::get_run_lock ()
+ {
+ return this->run_lock_;
+ }
+}
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.h b/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.h
new file mode 100644
index 00000000000..13f8f7d358d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/Runnable_exec_i.h
@@ -0,0 +1,70 @@
+// $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 "Messenger_svnt.h"
+#include "Messenger_exec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#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 TAO_Local_RefCounted_Object
+ {
+ public:
+ Runnable_exec_i ();
+ virtual ~Runnable_exec_i (void);
+
+ // Operations from ::Runnable
+
+ virtual void
+ start ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void
+ stop ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // MY CODE
+
+ ACE_Mutex& get_run_lock();
+
+ private:
+ ACE_Mutex run_lock_;
+ };
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_RUNNABLE_EXEC_H */
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc
new file mode 100644
index 00000000000..e9b29c24629
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc
@@ -0,0 +1,18 @@
+// -*- MPC -*-
+// $Id$
+
+project(Messenger_StaticDAnCE): ciao_static_dnc_app {
+ requires += cidl
+ exename = Messenger_StaticDAnCE
+
+ libs += Receiver_stub Administrator_stub Messenger_stub
+ libs += Receiver_svnt Administrator_svnt Messenger_svnt
+ libs += Receiver_exec Administrator_exec Messenger_exec
+
+ after += Receiver_exec Administrator_exec Messenger_exec
+
+ Source_Files {
+ StaticDAnCEApp.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/README.txt b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/README.txt
new file mode 100644
index 00000000000..fe5f0901380
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/README.txt
@@ -0,0 +1,33 @@
+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/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/StaticDAnCEApp.cpp b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/StaticDAnCEApp.cpp
new file mode 100644
index 00000000000..985173e5720
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/StaticDAnCEApp.cpp
@@ -0,0 +1,119 @@
+// $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"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Activate POA manager
+ PortableServer::POAManager_var mgr
+ = poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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; i<homes_table_size; ++i)
+ {
+ home_creator_fptr_map.bind (homes_table[i].executor_entrypt_,
+ homes_table[i].executor_fptr_);
+
+ homesvnt_creator_fptr_map.bind (homes_table[i].servant_entrypt_,
+ homes_table[i].servant_fptr_);
+ }
+
+ CIAO::Static_NodeManager_Impl *static_node_manager_impl;
+ // Create and install the CIAO Daemon servant
+
+ ACE_DEBUG ((LM_DEBUG, "creating static_node_manager\n"));
+
+ static_node_manager_impl =
+ new CIAO::Static_NodeManager_Impl("NodeManager",
+ orb.in (),
+ poa.in (),
+ "", //exe location
+ "", //exe options
+ 0, //spawn delay
+ &static_config_entrypoints_maps);
+
+ static_node_manager_impl->init ();
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ adapter->bind ("NodeManager",
+ str.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the main event loop for the ORB.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Caught CORBA Exception: ");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/plan.h b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/plan.h
new file mode 100644
index 00000000000..5e36d41628e
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/plan.h
@@ -0,0 +1,42 @@
+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/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/run_test.pl b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/run_test.pl
new file mode 100644
index 00000000000..c4c35677500
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/StaticDAnCE/run_test.pl
@@ -0,0 +1,108 @@
+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/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.ccd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.ccd
new file mode 100644
index 00000000000..23ba49bb84c
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.ccd
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentInterfaceDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Administrator Component</label>
+ <specificType>IDL:Administrator:1.0</specificType>
+ <supportedType>IDL:Administrator:1.0</supportedType>
+ <idlFile>Administrator.idl</idlFile>
+
+ <port>
+ <name>runnables</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>true</exclusiveUser>
+ <optional>true</optional>
+ <provider>false</provider>
+ <supportedType>IDL:Runnable:1.0</supportedType>
+ <specificType>IDL:Runnable:1.0</specificType>
+ <kind>MultiplexReceptacle</kind>
+ </port>
+
+ <port>
+ <name>content</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>true</exclusiveUser>
+ <optional>true</optional>
+ <provider>false</provider>
+ <supportedType>IDL:Publication:1.0</supportedType>
+ <specificType>IDL:Publication:1.0</specificType>
+ <kind>MultiplexReceptacle</kind>
+ </port>
+
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This CCD describes the Administrator's interface</string>
+ </value>
+ </value>
+ </infoProperty>
+
+</Deployment:ComponentInterfaceDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cid b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cid
new file mode 100644
index 00000000000..af9e9a4c677
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cid
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentImplementationDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Administrator Implementation</label>
+ <implements href="Administrator.ccd"/>
+ <monolithicImpl>
+ <primaryArtifact>
+ <name>Administrator_Stub</name>
+ <referencedArtifact href="Administrator_Stub.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Administrator_Svnt</name>
+ <referencedArtifact href="Administrator_Svnt.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Administrator_Exec</name>
+ <referencedArtifact href="Administrator_Exec.iad"/>
+ </primaryArtifact>
+ </monolithicImpl>
+ <configProperty>
+ <name>ComponentIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Administrator.ior</string>
+ </value>
+ </value>
+ </configProperty>
+</Deployment:ComponentImplementationDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cpd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cpd
new file mode 100644
index 00000000000..972966462e6
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator.cpd
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentPackageDescription
+xmlns:Deployment="http://www.omg.org/Deployment"
+xmlns:xmi="http://www.omg.org/XMI"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+
+ <label>Administrator Component</label>
+ <realizes href="Administrator.ccd"/>
+ <implementation>
+ <name>AdministratorImpl</name>
+ <referencedImplementation href="Administrator.cid"/>
+ </implementation>
+
+</Deployment:ComponentPackageDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Exec.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Exec.iad
new file mode 100644
index 00000000000..81b7a16da7a
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Exec.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Administrator Executor Artifact</label>
+ <location>Administrator_exec</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Administrator_Stub</name>
+ <referencedArtifact href="Administrator_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createAdministratorHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Administrator's executor library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Stub.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Stub.iad
new file mode 100644
index 00000000000..931fc371710
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Stub.iad
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Administrator Stub Artifact</label>
+ <location>Administrator_stub</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Messenger_Stub</name>
+ <referencedArtifact href="Messenger_Stub.iad"/>
+ </dependsOn>
+
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Administrator's stub library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Svnt.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Svnt.iad
new file mode 100644
index 00000000000..6774a107ef0
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Administrator_Svnt.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Administrator Servant Artifact</label>
+ <location>Administrator_svnt</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Administrator_Stub</name>
+ <referencedArtifact href="Administrator_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createAdministratorHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Administrator's servant library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application-flattened.cdp b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application-flattened.cdp
new file mode 100644
index 00000000000..d01ec12e2db
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application-flattened.cdp
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:deploymentPlan
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+
+ <label>Messenger Deployment Plan</label>
+
+ <!-- realizes -->
+
+ <!-- implementation* -->
+
+ <implementation id="MessengerImpl"> <!-- from Messenger.cpd -->
+ <name>MessengerImpl</name>
+ <source></source>
+ <!-- from Messenger.cid -->
+ <artifact>Messenger_Stub</artifact>
+ <artifact>Messenger_Svnt</artifact>
+ <artifact>Messenger_Exec</artifact>
+ </implementation>
+
+ <implementation id="ReceiverImpl"> <!-- from Receiver.cpd -->
+ <name>ReceiverImpl</name>
+ <source></source>
+ <artifact>Receiver_Stub</artifact>
+ <artifact>Receiver_Svnt</artifact>
+ <artifact>Receiver_Exec</artifact>
+ </implementation>
+
+ <implementation id="AdministratorImpl"> <!-- from Administrator.cpd -->
+ <name>AdministratorImpl</name>
+ <source></source>
+ <artifact>Administrator_Stub</artifact>
+ <artifact>Administrator_Svnt</artifact>
+ <artifact>Administrator_Exec</artifact>
+ </implementation>
+
+ <!-- instance* -->
+
+ <instance id="Messenger_Instance_ID">
+ <name>Messenger_Instance</name>
+ <node>Messenger_Node</node>
+ <source></source>
+ <implementation>MessengerImpl</implementation>
+ </instance>
+ <instance id="First_Receiver_Instance_ID">
+ <name>First_Receiver_Instance</name>
+ <node>First_Receiver_Node</node>
+ <source></source>
+ <implementation>ReceiverImpl</implementation>
+ </instance>
+ <instance id="Second_Receiver_Instance_ID">
+ <name>Second_Receiver_Instance</name>
+ <node>Second_Receiver_Node</node>
+ <source></source>
+ <implementation>ReceiverImpl</implementation>
+ </instance>
+ <instance id="Administrator_Instance_ID">
+ <name>Administrator_Instance</name>
+ <node>Administrator_Node</node>
+ <source></source>
+ <implementation>AdministratorImpl</implementation>
+ </instance>
+
+ <!-- connection* -->
+
+ <connection>
+ <name>Messenger_to_First_Receiver_Publish</name>
+ <internalEndpoint>
+ <portName>message_publisher</portName>
+ <kind>EventPublisher</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_consumer</portName>
+ <kind>EventConsumer</kind>
+ <instance>First_Receiver_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_First_Receiver_History</name>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <kind>Facet</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <kind>SimplexReceptacle</kind>
+ <instance>First_Receiver_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Second_Receiver_Publish</name>
+ <internalEndpoint>
+ <portName>message_publisher</portName>
+ <kind>EventPublisher</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_consumer</portName>
+ <kind>EventConsumer</kind>
+ <instance>Second_Receiver_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Second_Receiver_History</name>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <kind>Facet</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <kind>SimplexReceptacle</kind>
+ <instance>Second_Receiver_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Administrator_Control</name>
+ <internalEndpoint>
+ <portName>control</portName>
+ <kind>Facet</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>runnables</portName>
+ <kind>SimplexReceptacle</kind>
+ <instance>Administrator_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Administrator_Content</name>
+ <internalEndpoint>
+ <portName>content</portName>
+ <kind>Facet</kind>
+ <instance>Messenger_Instance_ID</instance>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>content</portName>
+ <kind>SimplexReceptacle</kind>
+ <instance>Administrator_Instance_ID</instance>
+ </internalEndpoint>
+ </connection>
+
+ <!-- artifact* (exec, svnt) -->
+
+ <artifact id="Messenger_Stub">
+ <name>Messenger_Stub</name>
+ <source></source>
+ <node></node>
+ <location>Messenger_stub</location>
+ </artifact>
+ <artifact id="Messenger_Svnt">
+ <name>Messenger_Svnt</name>
+ <source></source>
+ <node></node>
+ <location>Messenger_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_MessengerHome_Servant</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+ <artifact id="Messenger_Exec">
+ <name>Messenger_Exec</name>
+ <source></source>
+ <node></node>
+ <location>Messenger_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_MessengerHome_Impl</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact id="Receiver_Stub">
+ <name>Receiver_Stub</name>
+ <source></source>
+ <node></node>
+ <location>Receiver_stub</location>
+ </artifact>
+ <artifact id="Receiver_Svnt">
+ <name>Receiver_Svnt</name>
+ <source></source>
+ <node></node>
+ <location>Receiver_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_ReceiverHome_Servant</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+ <artifact id="Receiver_Exec">
+ <name>Receiver_Exec</name>
+ <source></source>
+ <node></node>
+ <location>Receiver_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_ReceiverHome_Impl</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact id="Administrator_Stub">
+ <name>Administrator_Stub</name>
+ <source></source>
+ <node></node>
+ <location>Administrator_stub</location>
+ </artifact>
+ <artifact id="Administrator_Svnt">
+ <name>Administrator_Svnt</name>
+ <source></source>
+ <node></node>
+ <location>Administrator_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_AdministratorHome_Servant</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+ <artifact id="Administrator_Exec">
+ <name>Administrator_Exec</name>
+ <source></source>
+ <node></node>
+ <location>Administrator_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type><kind>tk_string</kind></type>
+ <value><string>create_AdministratorHome_Impl</string></value>
+ </value>
+ </execParameter>
+ </artifact>
+
+
+</Deployment:deploymentPlan>
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.cdp b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.cdp
new file mode 100644
index 00000000000..9e774373c2f
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.cdp
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:DeploymentPlan
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Deployment Plan</label>
+ <instance xmi:id="Messenger_Instance_ID">
+ <name>Messenger_Instance</name>
+ <node>Messenger_Node</node>
+ </instance>
+ <instance xmi:id="First_Receiver_Instance_ID">
+ <name>First_Receiver_Instance</name>
+ <node>First_Receiver_Node</node>
+ </instance>
+ <instance xmi:id="Second_Receiver_Instance_ID">
+ <name>Second_Receiver_Instance</name>
+ <node>Second_Receiver_Node</node>
+ </instance>
+ <instance xmi:id="Administrator_Instance_ID">
+ <name>Administrator_Instance</name>
+ <node>Administrator_Node</node>
+ </instance>
+</Deployment:DeploymentPlan>
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.pcd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.pcd
new file mode 100644
index 00000000000..70635a4850b
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Application.pcd
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:PackageConfiguration
+xmlns:Deployment="http://www.omg.org/Deployment"
+xmlns:xmi="http://www.omg.org/XMI"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Application Configuration</label>
+ <basePackage href="MessengerAssembly.cpd"/>
+
+ <!-- CIAO does not yet pay attention to this -->
+ <configProperty>
+ <name>subject</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>My Subject</string>
+ </value>
+ </value>
+ </configProperty>
+</Deployment:PackageConfiguration>
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/ApplicationNodeMap.dat b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/ApplicationNodeMap.dat
new file mode 100644
index 00000000000..75f28747798
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/ApplicationNodeMap.dat
@@ -0,0 +1,4 @@
+Administrator_Node corbaloc:iiop:localhost:11000/NodeManager
+First_Receiver_Node corbaloc:iiop:localhost:22000/NodeManager
+Second_Receiver_Node corbaloc:iiop:localhost:33000/NodeManager
+Messenger_Node corbaloc:iiop:localhost:44000/NodeManager
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Deployment.xsd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Deployment.xsd
new file mode 100644
index 00000000000..ae9bc21965d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Deployment.xsd
@@ -0,0 +1,776 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ targetNamespace="http://www.omg.org/Deployment">
+
+ <xsd:import namespace="http://www.omg.org/XMI" schemaLocation="XMI.xsd" />
+
+
+ <xsd:complexType name="Any">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="type" type="Deployment:DataType"/>
+ <xsd:element name="value" type="Deployment:DataValue"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Any" type="Deployment:Any"/>
+ <xsd:complexType name="DataType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="kind" type="Deployment:TCKind"/>
+ <xsd:element name="enum" type="Deployment:EnumType"/>
+ <xsd:element name="objref" type="Deployment:ObjrefType"/>
+ <xsd:element name="boundedString" type="Deployment:BoundedStringType"/>
+ <xsd:element name="fixed" type="Deployment:FixedType"/>
+ <xsd:element name="array" type="Deployment:ArrayType"/>
+ <xsd:element name="sequence" type="Deployment:SequenceType"/>
+ <xsd:element name="alias" type="Deployment:AliasType"/>
+ <xsd:element name="struct" type="Deployment:StructType"/>
+ <xsd:element name="value" type="Deployment:ValueType"/>
+ <xsd:element name="union" type="Deployment:UnionType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="DataType" type="Deployment:DataType"/>
+ <xsd:complexType name="DataValue">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="short" type="xsd:short"/>
+ <xsd:element name="long" type="xsd:int"/>
+ <xsd:element name="ushort" type="xsd:unsignedShort"/>
+ <xsd:element name="ulong" type="xsd:unsignedInt"/>
+ <xsd:element name="float" type="xsd:float"/>
+ <xsd:element name="double" type="xsd:double"/>
+ <xsd:element name="boolean" type="xsd:boolean"/>
+ <xsd:element name="octet" type="xsd:unsignedByte"/>
+ <xsd:element name="opaque" type="xsd:base64Binary"/>
+ <xsd:element name="objref" type="xsd:string"/>
+ <xsd:element name="enum" type="xsd:string"/>
+ <xsd:element name="string" type="xsd:string"/>
+ <xsd:element name="longlong" type="xsd:long"/>
+ <xsd:element name="ulonglong" type="xsd:unsignedLong"/>
+ <xsd:element name="longdouble" type="xsd:double"/>
+ <xsd:element name="fixed" type="xsd:string"/>
+ <xsd:element name="any" type="Deployment:Any"/>
+ <xsd:element name="typecode" type="Deployment:DataType"/>
+ <xsd:element name="element" type="Deployment:DataValue"/>
+ <xsd:element name="discriminator" type="Deployment:DataValue"/>
+ <xsd:element name="value" type="Deployment:DataValue"/>
+ <xsd:element name="boxedValue" type="Deployment:DataValue"/>
+ <xsd:element name="member" type="Deployment:NamedValue"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="DataValue" type="Deployment:DataValue"/>
+
+
+ <xsd:complexType name="EnumType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ <xsd:element name="member" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="EnumType" type="Deployment:EnumType"/>
+ <xsd:complexType name="ObjrefType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+
+
+ <xsd:element name="ObjrefType" type="Deployment:ObjrefType"/>
+ <xsd:complexType name="BoundedStringType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="bound" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="BoundedStringType" type="Deployment:BoundedStringType"/>
+ <xsd:complexType name="FixedType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="digits" type="xsd:string"/>
+ <xsd:element name="scale" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="FixedType" type="Deployment:FixedType"/>
+ <xsd:complexType name="ArrayType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="length" type="xsd:string"/>
+ <xsd:element name="elementType" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ArrayType" type="Deployment:ArrayType"/>
+ <xsd:complexType name="SequenceType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="bound" type="xsd:string"/>
+ <xsd:element name="elementType" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SequenceType" type="Deployment:SequenceType"/>
+ <xsd:complexType name="AliasType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ <xsd:element name="elementType" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="AliasType" type="Deployment:AliasType"/>
+ <xsd:complexType name="StructType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ <xsd:element name="member" type="Deployment:StructMemberType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="StructType" type="Deployment:StructType"/>
+ <xsd:complexType name="StructMemberType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="type" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="StructMemberType" type="Deployment:StructMemberType"/>
+ <xsd:complexType name="ValueType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ <xsd:element name="modifier" type="xsd:string"/>
+ <xsd:element name="baseType" type="Deployment:DataType"/>
+ <xsd:element name="member" type="Deployment:ValueMemberType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ValueType" type="Deployment:ValueType"/>
+ <xsd:complexType name="ValueMemberType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="visibility" type="xsd:string"/>
+ <xsd:element name="type" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ValueMemberType" type="Deployment:ValueMemberType"/>
+ <xsd:complexType name="UnionType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="typeId" type="xsd:string"/>
+ <xsd:element name="default" type="Deployment:UnionMemberType"/>
+ <xsd:element name="discriminatorType" type="Deployment:DataType"/>
+ <xsd:element name="member" type="Deployment:UnionMemberType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="UnionType" type="Deployment:UnionType"/>
+ <xsd:complexType name="UnionMemberType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="type" type="Deployment:DataType"/>
+ <xsd:element name="label" type="Deployment:DataValue"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="UnionMemberType" type="Deployment:UnionMemberType"/>
+ <xsd:complexType name="NamedValue">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="value" type="Deployment:DataValue"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="NamedValue" type="Deployment:NamedValue"/>
+ <xsd:complexType name="Bridge">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="connect" type="Deployment:Interconnect"/>
+ <xsd:element name="resource" type="Deployment:Resource"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Bridge" type="Deployment:Bridge"/>
+ <xsd:complexType name="Interconnect">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="connection" type="Deployment:Bridge"/>
+ <xsd:element name="connect" type="Deployment:Node"/>
+ <xsd:element name="resource" type="Deployment:Resource"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Interconnect" type="Deployment:Interconnect"/>
+ <xsd:complexType name="Node">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="connection" type="Deployment:Interconnect"/>
+ <xsd:element name="sharedResource" type="Deployment:SharedResource"/>
+ <xsd:element name="resource" type="Deployment:Resource"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Node" type="Deployment:Node"/>
+ <xsd:complexType name="Resource">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="property" type="Deployment:SatisfierProperty"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Resource" type="Deployment:Resource"/>
+ <xsd:complexType name="SharedResource">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="node" type="Deployment:Node"/>
+ <xsd:element name="property" type="Deployment:SatisfierProperty"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SharedResource" type="Deployment:SharedResource"/>
+ <xsd:complexType name="Domain">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="sharedResource" type="Deployment:SharedResource"/>
+ <xsd:element name="node" type="Deployment:Node"/>
+ <xsd:element name="interconnect" type="Deployment:Interconnect"/>
+ <xsd:element name="bridge" type="Deployment:Bridge"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Domain" type="Deployment:Domain"/>
+ <xsd:complexType name="PlanPropertyMapping">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="source" type="xsd:string"/>
+ <xsd:element name="externalName" type="xsd:string"/>
+ <xsd:element name="delegatesTo" type="Deployment:PlanSubcomponentPropertyReference"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PlanPropertyMapping" type="Deployment:PlanPropertyMapping"/>
+ <xsd:complexType name="PlanSubcomponentPropertyReference">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="propertyName" type="xsd:string"/>
+ <xsd:element name="instance" type="Deployment:InstanceDeploymentDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PlanSubcomponentPropertyReference" type="Deployment:PlanSubcomponentPropertyReference"/>
+ <xsd:complexType name="PlanSubcomponentPortEndpoint">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="portName" type="xsd:string"/>
+ <xsd:element name="provider" type="xsd:string"/>
+ <xsd:element name="kind" type="Deployment:CCMComponentPortKind"/>
+ <xsd:element name="instance" type="Deployment:InstanceDeploymentDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PlanSubcomponentPortEndpoint" type="Deployment:PlanSubcomponentPortEndpoint"/>
+ <xsd:complexType name="PlanConnectionDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="source" type="xsd:string"/>
+ <xsd:element name="deployRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="externalEndpoint" type="Deployment:ComponentExternalPortEndpoint"/>
+ <xsd:element name="internalEndpoint" type="Deployment:PlanSubcomponentPortEndpoint"/>
+ <xsd:element name="externalReference" type="Deployment:ExternalReferenceEndpoint"/>
+ <xsd:element name="deployedResource" type="Deployment:ConnectionResourceDeploymentDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PlanConnectionDescription" type="Deployment:PlanConnectionDescription"/>
+ <xsd:complexType name="InstanceDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="node" type="xsd:string"/>
+ <xsd:element name="source" type="xsd:string"/>
+ <xsd:element name="implementation" type="Deployment:MonolithicDeploymentDescription"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ <xsd:element name="deployedResource" type="Deployment:InstanceResourceDeploymentDescription"/>
+ <xsd:element name="deployedSharedResource" type="Deployment:InstanceResourceDeploymentDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="InstanceDeploymentDescription" type="Deployment:InstanceDeploymentDescription"/>
+ <xsd:complexType name="MonolithicDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="source" type="xsd:string"/>
+ <xsd:element name="artifact" type="Deployment:ArtifactDeploymentDescription"/>
+ <xsd:element name="execParameter" type="Deployment:Property"/>
+ <xsd:element name="deployRequirement" type="Deployment:Requirement"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="MonolithicDeploymentDescription" type="Deployment:MonolithicDeploymentDescription"/>
+ <xsd:complexType name="ArtifactDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="location" type="xsd:string"/>
+ <xsd:element name="node" type="xsd:string"/>
+ <xsd:element name="source" type="xsd:string"/>
+ <xsd:element name="execParameter" type="Deployment:Property"/>
+ <xsd:element name="deployRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="deployedResource" type="Deployment:ResourceDeploymentDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ArtifactDeploymentDescription" type="Deployment:ArtifactDeploymentDescription"/>
+
+
+ <xsd:complexType name="DeploymentPlan">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="realizes" type="Deployment:ComponentInterfaceDescription"/>
+ <xsd:element name="implementation" type="Deployment:MonolithicDeploymentDescription"/>
+ <xsd:element name="instance" type="Deployment:InstanceDeploymentDescription"/>
+ <xsd:element name="connection" type="Deployment:PlanConnectionDescription"/>
+ <xsd:element name="externalProperty" type="Deployment:PlanPropertyMapping"/>
+ <xsd:element name="dependsOn" type="Deployment:ImplementationDependency"/>
+ <xsd:element name="artifact" type="Deployment:ArtifactDeploymentDescription"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="DeploymentPlan" type="Deployment:DeploymentPlan"/>
+
+
+ <xsd:complexType name="ResourceDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="requirementName" type="xsd:string"/>
+ <xsd:element name="resourceName" type="xsd:string"/>
+ <xsd:element name="resourceValue" type="Deployment:Any"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ResourceDeploymentDescription" type="Deployment:ResourceDeploymentDescription"/>
+ <xsd:complexType name="InstanceResourceDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="resourceUsage" type="Deployment:ResourceUsageKind"/>
+ <xsd:element name="requirementName" type="xsd:string"/>
+ <xsd:element name="resourceName" type="xsd:string"/>
+ <xsd:element name="resourceValue" type="Deployment:Any"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="InstanceResourceDeploymentDescription" type="Deployment:InstanceResourceDeploymentDescription"/>
+ <xsd:complexType name="ConnectionResourceDeploymentDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="targetName" type="xsd:string"/>
+ <xsd:element name="requirementName" type="xsd:string"/>
+ <xsd:element name="resourceName" type="xsd:string"/>
+ <xsd:element name="resourceValue" type="Deployment:Any"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ConnectionResourceDeploymentDescription" type="Deployment:ConnectionResourceDeploymentDescription"/>
+ <xsd:complexType name="Capability">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="property" type="Deployment:SatisfierProperty"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Capability" type="Deployment:Capability"/>
+ <xsd:complexType name="ComponentPropertyDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="type" type="Deployment:DataType"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentPropertyDescription" type="Deployment:ComponentPropertyDescription"/>
+ <xsd:complexType name="ComponentPortDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="specificType" type="xsd:string"/>
+ <xsd:element name="supportedType" type="xsd:string"/>
+ <xsd:element name="provider" type="xsd:string"/>
+ <xsd:element name="exclusiveProvider" type="xsd:string"/>
+ <xsd:element name="exclusiveUser" type="xsd:string"/>
+ <xsd:element name="optional" type="xsd:string"/>
+ <xsd:element name="kind" type="Deployment:CCMComponentPortKind"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentPortDescription" type="Deployment:ComponentPortDescription"/>
+ <xsd:complexType name="ComponentInterfaceDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="specificType" type="xsd:string"/>
+ <xsd:element name="supportedType" type="xsd:string"/>
+ <xsd:element name="idlFile" type="xsd:string"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ <xsd:element name="port" type="Deployment:ComponentPortDescription"/>
+ <xsd:element name="property" type="Deployment:ComponentPropertyDescription"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentInterfaceDescription" type="Deployment:ComponentInterfaceDescription"/>
+ <xsd:complexType name="ImplementationArtifactDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="location" type="xsd:string"/>
+ <xsd:element name="execParameter" type="Deployment:Property"/>
+ <xsd:element name="deployRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="dependsOn" type="Deployment:NamedImplementationArtifact"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ImplementationArtifactDescription" type="Deployment:ImplementationArtifactDescription"/>
+ <xsd:complexType name="MonolithicImplementationDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="execParameter" type="Deployment:Property"/>
+ <xsd:element name="primaryArtifact" type="Deployment:NamedImplementationArtifact"/>
+ <xsd:element name="deployRequirement" type="Deployment:ImplementationRequirement"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="MonolithicImplementationDescription" type="Deployment:MonolithicImplementationDescription"/>
+ <xsd:complexType name="AssemblyPropertyMapping">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="externalName" type="xsd:string"/>
+ <xsd:element name="delegatesTo" type="Deployment:SubcomponentPropertyReference"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="AssemblyPropertyMapping" type="Deployment:AssemblyPropertyMapping"/>
+ <xsd:complexType name="SubcomponentPropertyReference">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="propertyName" type="xsd:string"/>
+ <xsd:element name="instance" type="Deployment:SubcomponentInstantiationDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SubcomponentPropertyReference" type="Deployment:SubcomponentPropertyReference"/>
+ <xsd:complexType name="SubcomponentPortEndpoint">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="portName" type="xsd:string"/>
+ <xsd:element name="instance" type="Deployment:SubcomponentInstantiationDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SubcomponentPortEndpoint" type="Deployment:SubcomponentPortEndpoint"/>
+ <xsd:complexType name="AssemblyConnectionDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="deployRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="externalEndpoint" type="Deployment:ComponentExternalPortEndpoint"/>
+ <xsd:element name="internalEndpoint" type="Deployment:SubcomponentPortEndpoint"/>
+ <xsd:element name="externalReference" type="Deployment:ExternalReferenceEndpoint"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="AssemblyConnectionDescription" type="Deployment:AssemblyConnectionDescription"/>
+ <xsd:complexType name="SubcomponentInstantiationDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="package" type="Deployment:ComponentPackageDescription"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ <xsd:element name="selectRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="reference" type="Deployment:ComponentPackageReference"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SubcomponentInstantiationDescription" type="Deployment:SubcomponentInstantiationDescription"/>
+ <xsd:complexType name="ComponentAssemblyDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="instance" type="Deployment:SubcomponentInstantiationDescription"/>
+ <xsd:element name="connection" type="Deployment:AssemblyConnectionDescription"/>
+ <xsd:element name="externalProperty" type="Deployment:AssemblyPropertyMapping"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentAssemblyDescription" type="Deployment:ComponentAssemblyDescription"/>
+ <xsd:complexType name="ComponentImplementationDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="implements" type="Deployment:ComponentInterfaceDescription"/>
+ <xsd:element name="assemblyImpl" type="Deployment:ComponentAssemblyDescription"/>
+ <xsd:element name="monolithicImpl" type="Deployment:MonolithicImplementationDescription"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ <xsd:element name="capability" type="Deployment:Capability"/>
+ <xsd:element name="dependsOn" type="Deployment:ImplementationDependency"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentImplementationDescription" type="Deployment:ComponentImplementationDescription"/>
+ <xsd:complexType name="ComponentPackageReference">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="requiredUUID" type="xsd:string"/>
+ <xsd:element name="requiredName" type="xsd:string"/>
+ <xsd:element name="requiredType" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentPackageReference" type="Deployment:ComponentPackageReference"/>
+ <xsd:complexType name="ComponentPackageDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="realizes" type="Deployment:ComponentInterfaceDescription"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ <xsd:element name="implementation" type="Deployment:PackagedComponentImplementation"/>
+ <xsd:element name="infoProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentPackageDescription" type="Deployment:ComponentPackageDescription"/>
+ <xsd:complexType name="PackageConfiguration">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="label" type="xsd:string"/>
+ <xsd:element name="UUID" type="xsd:string"/>
+ <xsd:element name="specializedConfig" type="Deployment:PackageConfiguration"/>
+ <xsd:element name="basePackage" type="Deployment:ComponentPackageDescription"/>
+ <xsd:element name="reference" type="Deployment:ComponentPackageReference"/>
+ <xsd:element name="selectRequirement" type="Deployment:Requirement"/>
+ <xsd:element name="configProperty" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PackageConfiguration" type="Deployment:PackageConfiguration"/>
+ <xsd:complexType name="PackagedComponentImplementation">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="referencedImplementation" type="Deployment:ComponentImplementationDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="PackagedComponentImplementation" type="Deployment:PackagedComponentImplementation"/>
+ <xsd:complexType name="NamedImplementationArtifact">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="referencedArtifact" type="Deployment:ImplementationArtifactDescription"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="NamedImplementationArtifact" type="Deployment:NamedImplementationArtifact"/>
+ <xsd:complexType name="ImplementationRequirement">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="resourceUsage" type="Deployment:ResourceUsageKind"/>
+ <xsd:element name="resourcePort" type="xsd:string"/>
+ <xsd:element name="componentPort" type="xsd:string"/>
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="property" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ImplementationRequirement" type="Deployment:ImplementationRequirement"/>
+ <xsd:complexType name="RequirementSatisfier">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="property" type="Deployment:SatisfierProperty"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="RequirementSatisfier" type="Deployment:RequirementSatisfier"/>
+ <xsd:complexType name="SatisfierProperty">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="kind" type="Deployment:SatisfierPropertyKind"/>
+ <xsd:element name="value" type="Deployment:Any"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="SatisfierProperty" type="Deployment:SatisfierProperty"/>
+ <xsd:complexType name="Requirement">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="resourceType" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="property" type="Deployment:Property"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Requirement" type="Deployment:Requirement"/>
+ <xsd:complexType name="Property">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="value" type="Deployment:Any"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="Property" type="Deployment:Property"/>
+ <xsd:complexType name="ExternalReferenceEndpoint">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="location" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ExternalReferenceEndpoint" type="Deployment:ExternalReferenceEndpoint"/>
+ <xsd:complexType name="ComponentExternalPortEndpoint">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="portName" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ComponentExternalPortEndpoint" type="Deployment:ComponentExternalPortEndpoint"/>
+ <xsd:complexType name="ImplementationDependency">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="requiredType" type="xsd:string"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="ImplementationDependency" type="Deployment:ImplementationDependency"/>
+ <xsd:complexType name="TopLevelPackageDescription">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="package" type="Deployment:PackageConfiguration"/>
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" use="optional"/>
+ <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
+ </xsd:complexType>
+ <xsd:element name="TopLevelPackageDescription" type="Deployment:TopLevelPackageDescription"/>
+ <xsd:simpleType name="TCKind">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="tk_null"/>
+ <xsd:enumeration value="tk_void"/>
+ <xsd:enumeration value="tk_short"/>
+ <xsd:enumeration value="tk_long"/>
+ <xsd:enumeration value="tk_ushort"/>
+ <xsd:enumeration value="tk_ulong"/>
+ <xsd:enumeration value="tk_float"/>
+ <xsd:enumeration value="tk_double"/>
+ <xsd:enumeration value="tk_boolean"/>
+ <xsd:enumeration value="tk_char"/>
+ <xsd:enumeration value="tk_octet"/>
+ <xsd:enumeration value="tk_any"/>
+ <xsd:enumeration value="tk_TypeCode"/>
+ <xsd:enumeration value="tk_Principal"/>
+ <xsd:enumeration value="tk_objref"/>
+ <xsd:enumeration value="tk_struct"/>
+ <xsd:enumeration value="tk_union"/>
+ <xsd:enumeration value="tk_enum"/>
+ <xsd:enumeration value="tk_string"/>
+ <xsd:enumeration value="tk_sequence"/>
+ <xsd:enumeration value="tk_array"/>
+ <xsd:enumeration value="tk_alias"/>
+ <xsd:enumeration value="tk_except"/>
+ <xsd:enumeration value="tk_longlong"/>
+ <xsd:enumeration value="tk_ulonglong"/>
+ <xsd:enumeration value="tk_longdouble"/>
+ <xsd:enumeration value="tk_wchar"/>
+ <xsd:enumeration value="tk_wstring"/>
+ <xsd:enumeration value="tk_wfixed"/>
+ <xsd:enumeration value="tk_value"/>
+ <xsd:enumeration value="tk_value_box"/>
+ <xsd:enumeration value="tk_native"/>
+ <xsd:enumeration value="tk_abstract_interface"/>
+ <xsd:enumeration value="tk_local_interface"/>
+ <xsd:enumeration value="tk_component"/>
+ <xsd:enumeration value="tk_home"/>
+ <xsd:enumeration value="tk_event"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="ResourceUsageKind">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="None"/>
+ <xsd:enumeration value="InstanceUsesResource"/>
+ <xsd:enumeration value="ResourceUsesInstance"/>
+ <xsd:enumeration value="PortUsesResource"/>
+ <xsd:enumeration value="ResourceUsesPort"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="CCMComponentPortKind">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Facet"/>
+ <xsd:enumeration value="SimplexReceptacle"/>
+ <xsd:enumeration value="MultiplexReceptacle"/>
+ <xsd:enumeration value="EventEmitter"/>
+ <xsd:enumeration value="EventPublisher"/>
+ <xsd:enumeration value="EventConsumer"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="SatisfierPropertyKind">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Quantity"/>
+ <xsd:enumeration value="Capacity"/>
+ <xsd:enumeration value="Minimum"/>
+ <xsd:enumeration value="Maximum"/>
+ <xsd:enumeration value="Attribute"/>
+ <xsd:enumeration value="Selection"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+</xsd:schema>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Domain.cdd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Domain.cdd
new file mode 100644
index 00000000000..54a8c1f5a82
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Domain.cdd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Deployment:Domain
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+<label>Messenger Application Domain</label>
+<node>
+ <name>Messenger_Node</name>
+ <label>Messenger's Node</label>
+</node>
+<node>
+ <name>First_Receiver_Node</name>
+ <label>First Receiver's Node</label>
+</node>
+<node>
+ <name>Second_Receiver_Node</name>
+ <label>Second Receiver's Node</label>
+</node>
+<node>
+ <name>Administrator_Node</name>
+ <label>Administrator's Node</label>
+</node>
+</Deployment:Domain>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Libraries.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Libraries.iad
new file mode 100644
index 00000000000..d861613c157
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Libraries.iad
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>ACE/TAO/CIAO Libraries</label>
+ <location>$ACE_ROOT/lib/ACE</location>
+ <location>$ACE_ROOT/lib/TAO</location>
+ <location>$ACE_ROOT/lib/CIAO_Client</location>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.ccd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.ccd
new file mode 100644
index 00000000000..cf79d7fb9f7
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.ccd
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentInterfaceDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Component</label>
+ <specificType>IDL:Messenger:1.0</specificType>
+ <idlFile>Messenger.idl</idlFile>
+
+ <property>
+ <name>subject</name>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ </property>
+
+ <port>
+ <name>control</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>false</exclusiveUser>
+ <optional>true</optional>
+ <provider>true</provider>
+ <supportedType>IDL:Runnable:1.0</supportedType>
+ <specificType>IDL:Runnable:1.0</specificType>
+ <kind>Facet</kind>
+ </port>
+
+ <port>
+ <name>content</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>false</exclusiveUser>
+ <optional>true</optional>
+ <provider>true</provider>
+ <supportedType>IDL:Publication:1.0</supportedType>
+ <specificType>IDL:Publication:1.0</specificType>
+ <kind>Facet</kind>
+ </port>
+
+ <port>
+ <name>message_publisher</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>false</exclusiveUser>
+ <optional>true</optional>
+ <provider>false</provider>
+ <supportedType>IDL:Message:1.0</supportedType>
+ <specificType>IDL:Message:1.0</specificType>
+ <kind>EventPublisher</kind>
+ </port>
+
+ <port>
+ <name>message_history</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>false</exclusiveUser>
+ <optional>true</optional>
+ <provider>true</provider>
+ <supportedType>IDL:History:1.0</supportedType>
+ <specificType>IDL:History:1.0</specificType>
+ <kind>Facet</kind>
+ </port>
+
+ <!-- Default value for subject property, can be overridden.
+ CIAO does not process this (yet)
+ -->
+ <configProperty>
+ <name>subject</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Default Subject</string>
+ </value>
+ </value>
+ </configProperty>
+
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This CCD describes the Messenger's interface</string>
+ </value>
+ </value>
+ </infoProperty>
+
+</Deployment:ComponentInterfaceDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cid b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cid
new file mode 100644
index 00000000000..c4e934f1ee2
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cid
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentImplementationDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Implementation</label>
+ <implements href="Messenger.ccd"/>
+ <monolithicImpl>
+ <primaryArtifact>
+ <name>Messenger_Stub</name>
+ <referencedArtifact href="Messenger_Stub.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Messenger_Svnt</name>
+ <referencedArtifact href="Messenger_Svnt.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Messenger_Exec</name>
+ <referencedArtifact href="Messenger_Exec.iad"/>
+ </primaryArtifact>
+ </monolithicImpl>
+
+ <configProperty>
+ <name>ComponentIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Messenger.ior</string>
+ </value>
+ </value>
+ </configProperty>
+
+</Deployment:ComponentImplementationDescription>
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cpd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cpd
new file mode 100644
index 00000000000..ee624b9bce5
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger.cpd
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentPackageDescription
+xmlns:Deployment="http://www.omg.org/Deployment"
+xmlns:xmi="http://www.omg.org/XMI"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+
+ <label>Messenger Component</label>
+ <realizes href="Messenger.ccd"/>
+ <implementation>
+ <name>MessengerImpl</name>
+ <referencedImplementation href="Messenger.cid"/>
+ </implementation>
+
+</Deployment:ComponentPackageDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.ccd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.ccd
new file mode 100644
index 00000000000..c048d99133d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.ccd
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentInterfaceDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Assembly</label>
+
+ <property>
+ <name>subject</name>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ </property>
+
+ <!-- Default value for subject property, can be overridden.
+ CIAO does not process this (yet)
+ -->
+ <configProperty>
+ <name>subject</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Default Subject</string>
+ </value>
+ </value>
+ </configProperty>
+
+</Deployment:ComponentInterfaceDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cid b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cid
new file mode 100644
index 00000000000..bd0bf4e56ce
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cid
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentImplementationDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Assembly</label>
+ <implements href="MessengerAssembly.ccd"/>
+ <assemblyImpl>
+ <instance xmi:id="a_Messenger">
+ <name>Messenger_Instance</name>
+ <package href="Messenger.cpd"/>
+ </instance>
+ <instance xmi:id="first_Receiver">
+ <name>First_Receiver_Instance</name>
+ <package href="Receiver.cpd"/>
+ </instance>
+ <instance xmi:id="second_Receiver">
+ <name>Second_Receiver_Instance</name>
+ <package href="Receiver.cpd"/>
+ </instance>
+ <instance xmi:id="a_Administrator">
+ <name>Administrator_Instance</name>
+ <package href="Administrator.cpd"/>
+ </instance>
+
+ <connection>
+ <name>Messenger_to_First_Receiver_Publish</name>
+ <internalEndpoint>
+ <portName>message_publisher</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_consumer</portName>
+ <instance xmi:idref="first_Receiver"/>
+ </internalEndpoint>
+ </connection>
+ <connection>
+ <name>Messenger_to_First_Receiver_History</name>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <instance xmi:idref="first_Receiver"/>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Second_Receiver_Publisher</name>
+ <internalEndpoint>
+ <portName>message_publisher</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_consumer</portName>
+ <instance xmi:idref="second_Receiver"/>
+ </internalEndpoint>
+ </connection>
+ <connection>
+ <name>Messenger_to_Second_Receiver_History</name>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>message_history</portName>
+ <instance xmi:idref="second_Receiver"/>
+ </internalEndpoint>
+ </connection>
+
+ <connection>
+ <name>Messenger_to_Administrator_Control</name>
+ <internalEndpoint>
+ <portName>control</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>runnables</portName>
+ <instance xmi:idref="a_Administrator"/>
+ </internalEndpoint>
+ </connection>
+ <connection>
+ <name>Messenger_to_Administrator_Content</name>
+ <internalEndpoint>
+ <portName>content</portName>
+ <instance xmi:idref="a_Messenger"/>
+ </internalEndpoint>
+ <internalEndpoint>
+ <portName>content</portName>
+ <instance xmi:idref="a_Administrator"/>
+ </internalEndpoint>
+ </connection>
+
+ <!--
+ Not sure that externalName has to match.
+ Don't know if CIAO processes this yet.
+ -->
+ <externalProperty>
+ <name>Subject Mapping</name>
+ <externalName>subject</externalName>
+ <delegatesTo>
+ <propertyName>subject</propertyName>
+ <instance xmi:idref="a_Messenger"/>
+ </delegatesTo>
+ </externalProperty>
+
+ </assemblyImpl>
+</Deployment:ComponentImplementationDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cpd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cpd
new file mode 100644
index 00000000000..a719ad571c9
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/MessengerAssembly.cpd
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentPackageDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Assembly Package</label>
+ <realizes href="MessengerAssembly.ccd"/>
+ <implementation>
+ <name>Messenger Application</name>
+ <referencedImplementation href="MessengerAssembly.cid"/>
+ </implementation>
+</Deployment:ComponentPackageDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Exec.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Exec.iad
new file mode 100644
index 00000000000..0b8cef2092c
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Exec.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Executor Artifact</label>
+ <location>Messenger_exec</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Messenger_Stub</name>
+ <referencedArtifact href="Messenger_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createMessengerHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Messenger's executor library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Stub.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Stub.iad
new file mode 100644
index 00000000000..50447209f50
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Stub.iad
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Stub Artifact</label>
+ <location>Messenger_stub</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Messenger's stub library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Svnt.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Svnt.iad
new file mode 100644
index 00000000000..29b83d63e53
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Messenger_Svnt.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Messenger Servant Artifact</label>
+ <location>Messenger_svnt</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Messenger_Stub</name>
+ <referencedArtifact href="Messenger_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createMessengerHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Messenger's servant library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/README_15a b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/README_15a
new file mode 100644
index 00000000000..ac466837dc4
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/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/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.ccd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.ccd
new file mode 100644
index 00000000000..3094ae368dc
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.ccd
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentInterfaceDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Receiver Component</label>
+ <specificType>IDL:Receiver:1.0</specificType>
+ <supportedType>IDL:Receiver:1.0</supportedType>
+ <idlFile>Receiver.idl</idlFile>
+
+ <port>
+ <name>message_consumer</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>false</exclusiveUser>
+ <optional>false</optional>
+ <provider>true</provider>
+ <supportedType>IDL:Message:1.0</supportedType>
+ <specificType>IDL:Message:1.0</specificType>
+ <kind>EventConsumer</kind>
+ </port>
+
+ <port>
+ <name>message_history</name>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>true</exclusiveUser>
+ <optional>true</optional>
+ <provider>false</provider>
+ <supportedType>IDL:History:1.0</supportedType>
+ <specificType>IDL:History:1.0</specificType>
+ <kind>SimplexReceptacle</kind>
+ </port>
+
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This CCD describes the Receiver's interface</string>
+ </value>
+ </value>
+ </infoProperty>
+
+</Deployment:ComponentInterfaceDescription>
+
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cid b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cid
new file mode 100644
index 00000000000..c5c85d648da
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cid
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentImplementationDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Receiver Implementation</label>
+ <implements href="Receiver.ccd"/>
+ <monolithicImpl>
+ <primaryArtifact>
+ <name>Receiver_Stub</name>
+ <referencedArtifact href="Receiver_Stub.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Receiver_Svnt</name>
+ <referencedArtifact href="Receiver_Svnt.iad"/>
+ </primaryArtifact>
+ <primaryArtifact>
+ <name>Receiver_Exec</name>
+ <referencedArtifact href="Receiver_Exec.iad"/>
+ </primaryArtifact>
+ </monolithicImpl>
+ <configProperty>
+ <name>ComponentIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Receiver.ior</string>
+ </value>
+ </value>
+ </configProperty>
+</Deployment:ComponentImplementationDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cpd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cpd
new file mode 100644
index 00000000000..8b8ff890fa2
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver.cpd
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ComponentPackageDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+
+ <label>Receiver Component</label>
+ <realizes href="Receiver.ccd"/>
+ <implementation>
+ <name>ReceiverImpl</name>
+ <referencedImplementation href="Receiver.cid"/>
+ </implementation>
+
+</Deployment:ComponentPackageDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Exec.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Exec.iad
new file mode 100644
index 00000000000..adcee103c94
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Exec.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Receiver Executor Artifact</label>
+ <location>Receiver_exec</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Receiver_Stub</name>
+ <referencedArtifact href="Receiver_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createReceiverHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Receiver's executor library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Stub.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Stub.iad
new file mode 100644
index 00000000000..63d7e37cc8e
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Stub.iad
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Receiver Stub Artifact</label>
+ <location>Receiver_stub</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Messenger_Stub</name>
+ <referencedArtifact href="Messenger_Stub.iad"/>
+ </dependsOn>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Receiver's stub library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Svnt.iad b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Svnt.iad
new file mode 100644
index 00000000000..8e3bf58d965
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/Receiver_Svnt.iad
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:ImplementationArtifactDescription
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>Receiver Servant Artifact</label>
+ <location>Receiver_svnt</location>
+ <dependsOn>
+ <name>ACE/TAO/CIAO</name>
+ <referencedArtifact href="Libraries.iad"/>
+ </dependsOn>
+ <dependsOn>
+ <name>Receiver_Stub</name>
+ <referencedArtifact href="Receiver_Stub.iad"/>
+ </dependsOn>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createReceiverHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <!-- infoProperty elements are optional, and are non-functional -->
+ <infoProperty>
+ <name>comment</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>This IAD describes the Receiver's servant library</string>
+ </value>
+ </value>
+ </infoProperty>
+</Deployment:ImplementationArtifactDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/XMI.xsd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/XMI.xsd
new file mode 100644
index 00000000000..f4adac91934
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/XMI.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" ?>
+<xsd:schema targetNamespace="http://www.omg.org/XMI" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'>
+ <xsd:attribute name="id" type="xsd:ID" />
+ <xsd:attributeGroup name="IdentityAttribs">
+ <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" />
+ <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" />
+ </xsd:attributeGroup>
+ <xsd:attributeGroup name="LinkAttribs">
+ <xsd:attribute name="href" type="xsd:string" use="optional" />
+ <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" />
+ </xsd:attributeGroup>
+ <xsd:attributeGroup name="ObjectAttribs">
+ <xsd:attributeGroup ref="xmi:IdentityAttribs" />
+ <xsd:attributeGroup ref="xmi:LinkAttribs" />
+ <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" />
+ <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" />
+ </xsd:attributeGroup>
+ <xsd:complexType name="Extension">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:any processContents="lax" />
+ </xsd:choice>
+ <xsd:attribute ref="xmi:id" />
+ <xsd:attributeGroup ref="xmi:ObjectAttribs" />
+ <xsd:attribute name="extender" type="xsd:string" use="optional" />
+ <xsd:attribute name="extenderID" type="xsd:string" use="optional" />
+ </xsd:complexType>
+ <xsd:element name="Extension" type="xmi:Extension" />
+ <xsd:complexType name="Any">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:any processContents="skip" />
+ </xsd:choice>
+ <xsd:anyAttribute processContents="skip" />
+ </xsd:complexType>
+</xsd:schema>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/admin.dat b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/admin.dat
new file mode 100644
index 00000000000..f5815bb1f60
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/admin.dat
@@ -0,0 +1,7 @@
+1
+3
+1
+4
+Changing the publication text!
+2
+5
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/package.tpd b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/package.tpd
new file mode 100644
index 00000000000..f481b6bd789
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/package.tpd
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:TopLevelPackageDescription
+xmlns:Deployment="http://www.omg.org/Deployment"
+xmlns:xmi="http://www.omg.org/XMI"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <package href="Application.pcd"/>
+</Deployment:TopLevelPackageDescription>
diff --git a/TAO/DevGuideExamples/CIAO/Messenger/descriptors/run_test.pl b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/run_test.pl
new file mode 100644
index 00000000000..0741c971a5d
--- /dev/null
+++ b/TAO/DevGuideExamples/CIAO/Messenger/descriptors/run_test.pl
@@ -0,0 +1,109 @@
+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 ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager",
+ "-ORBEndpoint iiop://localhost:44000 -s $NA_cmd");
+
+# Each Node Manager lauches a Node Application process.
+open(STDIN, "<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 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 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);
+
+$NA1->Kill();
+$NA2->Kill();
+$NA3->Kill();
+$NA4->Kill();
+$EX->Kill();
+$EX2->Kill();
+$EM->Kill();
+
+unlink $emior;
+unlink $plior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/ChangeLog b/TAO/DevGuideExamples/ChangeLog
new file mode 100644
index 00000000000..10a0b3b91da
--- /dev/null
+++ b/TAO/DevGuideExamples/ChangeLog
@@ -0,0 +1,498 @@
+Wed Apr 23 13:09:22 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Disable the RTCORBA example for minimum CORBA and the like.
+
+Fri Apr 18 14:06:47 UTC 2008 Adam Mitz <mitza@ociweb.com>
+
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+
+ Also excluded the Bidir client from CORBA/e micro.
+
+Thu Apr 17 22:43:37 UTC 2008 Adam Mitz <mitza@ociweb.com>
+
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+ * ImplRepo/Basic/ImplRepo_Basic.mpc:
+ * ImplRepo/IORTable/ImplRepo_IORTable.mpc:
+ * ImplRepo/ImplRepo.mpc:
+ * devguide_examples.lst:
+
+ Excluded these from CORBA/e Micro builds.
+
+Wed Apr 9 14:44:33 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_Federated/supplier.conf:
+
+ Fixed a problem where the last line was continued with a backslash.
+
+Fri Apr 4 11:55:44 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * Messaging/AMIcallback/Messenger_i.cpp:
+
+ Remove vc8 warning about conversion from time_t to smaller type.
+
+Mon Feb 25 17:28:59 UTC 2008 Ciju John <johnc at ociweb dot com>
+
+ * DevGuideExamples/PortableInterceptors/IOR/run_test.pl:
+ Additional timeout for monitoring service ior.
+
+ * DevGuideExamples/EventServices/RTEC_Federated/supplier.conf:
+ Add block flushing and exclusive TransportMuxing
+ strategies. Adding these fixes scoreboard failures.
+
+Wed Sep 19 17:24:25 UTC 2007 Ciju John <johnc at ociweb dot com>
+
+ * DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp:
+ * DevGuideExamples/Security/SecurityUnawareApp/run_test.pl:
+ Fix app to mask expected exception. Also test script doesn't
+ exit on expected failure.
+
+Tue Dec 18 23:28:01 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * CIAO/Messenger/StaticDAnCE/run_test.pl:
+ * CIAO/Messenger/descriptors/run_test.pl:
+
+ Using PerlACE::Process to determine the real path to NodeApplication
+ since it may need to be modified by -ExeSubDir.
+
+Thu Oct 25 14:48:21 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Receiver.mpc:
+ * CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc:
+
+ Added "requires += cidl" to all projects that did not already have
+ it. This prevents the CIAO examples from being built when there is
+ no CIAO library built.
+
+Wed Oct 24 22:05:08 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * CIAO/Messenger/StaticDAnCE:
+ * CIAO/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc:
+ * CIAO/Messenger/StaticDAnCE/README.txt:
+ * CIAO/Messenger/StaticDAnCE/StaticDAnCEApp.cpp:
+ * CIAO/Messenger/StaticDAnCE/plan.h:
+ * CIAO/Messenger/StaticDAnCE/run_test.pl:
+
+ Added a new example that builds on the CIAO/Messenger example but
+ runs one of the four nodes statically (no dlopen, etc.).
+
+Wed Oct 24 19:08:46 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+ * CIAO/Messenger/Administrator_exec_i.h:
+ * CIAO/Messenger/Administrator_exec_i.cpp:
+ * CIAO/Messenger/History_exec_i.h:
+ * CIAO/Messenger/History_exec_i.cpp:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Messenger_exec_i.h:
+ * CIAO/Messenger/Messenger_exec_i.cpp:
+ * CIAO/Messenger/Publication_exec_i.h:
+ * CIAO/Messenger/Publication_exec_i.cpp:
+ * CIAO/Messenger/Receiver.mpc:
+ * CIAO/Messenger/Receiver_exec_i.h:
+ * CIAO/Messenger/Receiver_exec_i.cpp:
+ * CIAO/Messenger/Runnable_exec_i.h:
+ * CIAO/Messenger/Runnable_exec_i.cpp:
+ * CIAO/Messenger/descriptors/Application-flattened.cdp:
+ * CIAO/Messenger/descriptors/ApplicationNodeMap.dat:
+ * CIAO/Messenger/descriptors/README_15a:
+ * CIAO/Messenger/descriptors/run_test.pl:
+
+ Ported the CIAO example to TAO 1.5a (CIAO 0.5a).
+
+Fri Oct 19 20:56:50 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+ * Multithreading/GracefulShutdown/GracefulShutdown.mpc:
+ * NotifyService/Filtering/Filtering.mpc:
+
+ Added exename to account for the wchar changes (ACE_TMAIN).
+
+ * devguide_examples.lst:
+
+ Added the CIAO example, which is only run with -Config CIAO.
+
+Thu Oct 11 16:45:44 2007 ciju john <john_c@ociweb.com>
+
+ Importing entry from $TAO_ROOT/OCIChangeLog
+ Wed Sep 19 17:24:25 UTC 2007 Ciju John <johnc at ociweb dot com>
+ * DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp:
+ * DevGuideExamples/Security/SecurityUnawareApp/run_test.pl:
+ Fix app to mask expected exception. Also test script doesn't
+ exit on expected failure.
+
+Tue Oct 9 16:20:46 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * BiDirectionalGIOP/client.cpp:
+ * BiDirectionalGIOP/server.cpp:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Multithreading/GracefulShutdown/MessengerClient.cpp:
+ * Multithreading/GracefulShutdown/MessengerServer.h:
+ * Multithreading/GracefulShutdown/MessengerServer.cpp:
+ * NotifyService/Filtering/MessengerServer.cpp:
+ * NotifyService/Messenger/Messenger_i.cpp:
+ * NotifyService/RTNotify/Messenger_i.cpp:
+ * SmartProxies/Logger_i.h:
+ * SmartProxies/Logger_i.cpp:
+ * ValueTypes/Notify/consumer.cpp:
+
+ Fixes for ACE_USES_WCHAR builds.
+
+Mon Jul 23 14:17:47 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * LocalObjects/ServantLocator/ServantLocator.mpc:
+
+ Exclude this example from CORBA/e Compact and Micro builds.
+
+Fri Jun 15 21:54:31 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+
+ Changed code to match the new enumeration name in the IDL.
+
+Mon Jun 4 11:58:54 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.h:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+
+ Updated address server implementation to be consistent with the
+ interface.
+
+Thu May 10 11:44:16 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * NamingService/Naming_Server/MessengerTask.cpp:
+ * PortableInterceptors/Auth/ClientInterceptor.cpp:
+ * PortableInterceptors/Auth/ServerInterceptor.cpp:
+ * PortableInterceptors/IOR/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.cpp:
+
+ Replaced the old ACE_.*_cast with the corresponding C++ style
+ cast.
+
+Fri Apr 27 13:15:11 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Disable the PortableInterceptors examples if interceptors are
+ disabled.
+
+Fri Apr 27 13:12:00 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * PortableInterceptors/Auth/Auth.mpc:
+ * PortableInterceptors/IOR/IOR.mpc:
+ * PortableInterceptors/PICurrent/PICurrent.mpc:
+ * PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc:
+ * PortableInterceptors/SimpleCodec/SimpleCode.mpc:
+
+ Added interceptors to the inheritence list for the clients.
+
+Wed Mar 21 14:48:47 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH_AMI/run_test.pl:
+ * BiDirectionalGIOP/run_test.pl:
+ * EventServices/RTEC_Basic/run_test.pl:
+ * EventServices/RTEC_Federated/run_test.pl:
+ * EventServices/RTEC_Filter/run_test.pl:
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+ * ImplRepo/run_test.pl:
+ * Messaging/AMIcallback/run_test.pl:
+ * NamingService/Naming_Context_Ext/run_test.pl:
+ * NamingService/corbaloc_Messenger/run_test.pl:
+ * PortableInterceptors/Auth/run_test.pl:
+ * PortableInterceptors/IOR/run_test.pl:
+ * PortableInterceptors/PICurrent/run_test.pl:
+ * PortableInterceptors/PICurrent_NameService/run_test.pl:
+ * PortableInterceptors/SimpleCodec/run_test.pl:
+ * SmartProxies/run_test.pl:
+ * ValueTypes/Bank/run_test.pl:
+ * ValueTypes/Messenger/run_test.pl:
+
+ Increase timeouts to allow these to run on slower machines.
+
+Tue Feb 27 12:17:34 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * PortableInterceptors/PICurrent_NameService/run_test.pl:
+
+ I introduced a bug into this script. The MessengerServer does
+ not create an IOR file, just wait 1 second before starting the
+ client.
+
+Tue Feb 20 12:30:37 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * PortableInterceptors/Auth/run_test.pl:
+ * PortableInterceptors/IOR/run_test.pl:
+ * PortableInterceptors/PICurrent/run_test.pl:
+ * PortableInterceptors/PICurrent_NameService/run_test.pl:
+ * PortableInterceptors/SimpleCodec/run_test.pl:
+
+ Modified these tests to wait for the IOR file and then a half
+ second before starting the client. On slower machines, the client
+ could get a TRANSIENT exception by invoking a method on the server
+ before it's ready.
+
+Mon Feb 19 15:23:44 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * ImplRepo/run_test.pl:
+ * LocalObjects/ServantLocator/run_test.pl:
+ * Messaging/AMIcallback/run_test.pl:
+ * Messaging/RelativeRoundtripTimeout/run_test.pl:
+ * NamingService/Messenger/run_test.pl:
+ * NamingService/Naming_Client/run_test.pl:
+ * NamingService/Naming_Context_Ext/run_test.pl:
+ * NamingService/Naming_Server/run_test.pl:
+ * NamingService/corbaloc_Messenger/run_test.pl:
+ * NamingService/corbaname_Messenger/run_test.pl:
+ * NotifyService/EventSequence/run_test.pl:
+ * NotifyService/Filtering/run_test.pl:
+ * NotifyService/Messenger/run_test.pl:
+ * NotifyService/OfferSubscriptions/run_test.pl:
+ * NotifyService/QoSProperties/run_test.pl:
+ * NotifyService/RTNotify/run_test.pl:
+ * NotifyService/SupplierSideNC/run_test.pl:
+ * PortableInterceptors/Auth/run_test.pl:
+ * PortableInterceptors/IOR/run_test.pl:
+ * PortableInterceptors/PICurrent/run_test.pl:
+ * PortableInterceptors/PICurrent_NameService/run_test.pl:
+ * PortableInterceptors/SimpleCodec/run_test.pl:
+ * RTCORBA/run_test.pl:
+ * Security/ParticipatingApp/run_test.pl:
+ * Security/PolicyControllingApp/run_test.pl:
+ * Security/SecurityUnawareApp/run_test.pl:
+ * SmartProxies/run_test.pl:
+
+ Changed the return value check on SpawnWaitKill() from == -1 to !=
+ 0 to catch process failures instead of just process timeouts.
+
+Thu Feb 15 12:23:31 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * ValueTypes/Bank/bank.mpc:
+
+ With my rename from Wed Feb 14 14:29:40 UTC 2007, I forgot to
+ change the clients 'after' setting.
+
+Wed Feb 14 16:23:31 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * PortableInterceptors/PICurrent/ClientInitializer.h:
+ * PortableInterceptors/PICurrent/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerClient.cpp:
+
+ Moved the setting of the PICurrent slot data to after the ORB and
+ PICurrent object are initialized.
+
+Wed Feb 14 14:29:40 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * PortableInterceptors/Auth/MessengerClient.cpp:
+ * PortableInterceptors/Auth/MessengerServer.cpp:
+ * PortableInterceptors/IOR/MessengerClient.cpp:
+ * PortableInterceptors/IOR/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerServer.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerClient.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerServer.cpp:
+
+ Include either tao/PI_Server/PI_Server.h or tao/PI/PI.h to ensure
+ that the PI_Server or PI libraries are actually linked into the
+ executable when statically linking.
+
+Wed Feb 14 14:03:26 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ The ImplRepo test can no longer be run in a static build since the
+ ImR_Client library must be dynamically loaded in. It is part of
+ the PortableServer library in TAO 1.4a.
+
+Tue Feb 13 13:05:57 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Administrator_exec_i.h:
+ * CIAO/Messenger/Administrator_exec_i.cpp:
+ * CIAO/Messenger/History_exec_i.h:
+ * CIAO/Messenger/History_exec_i.cpp:
+ * CIAO/Messenger/Messenger_exec_i.h:
+ * CIAO/Messenger/Messenger_exec_i.cpp:
+ * CIAO/Messenger/Publication_exec_i.h:
+ * CIAO/Messenger/Publication_exec_i.cpp:
+ * CIAO/Messenger/Receiver_exec_i.h:
+ * CIAO/Messenger/Receiver_exec_i.cpp:
+ * CIAO/Messenger/Runnable_exec_i.h:
+ * CIAO/Messenger/Runnable_exec_i.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp:
+ * PortableInterceptors/IOR/ServerIORInterceptor.h:
+ * PortableInterceptors/IOR/ServerIORInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.cpp:
+
+ Removed the ACE exception macros.
+
+ * EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc:
+ * ValueTypes/Bank/bank.mpc:
+
+ Modified these project names so that they can be included in the
+ entire TAO workspace.
+
+Mon Feb 12 14:46:17 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH_AMI/AMH_AMI.mpc:
+
+ Re-arranged the generated source files so that they are at the
+ beginning (like MPC would do if it were automatically generating
+ the list of source files). This is required for template
+ instantiation to work properly for Visual Age 6.0.
+
+Thu Feb 8 14:32:40 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * LocalObjects/ServantLocator/ServantLocator.mpc:
+
+ Added the anytypecode base project for compatibility with this
+ change to TAO (see $TAO_ROOT/OCIChangeLog).
+ Thu Feb 8 14:28:06 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+Mon Feb 5 22:51:25 UTC 2007 Adam Mitz <mitza@ociweb.com>
+
+ * ValueTypes/Notify/Event.idl:
+ * ValueTypes/Notify/Event_i.h:
+
+ Replaced a custom typedef for sequence<long> with CORBA::LongSeq.
+ Using the type provided by the C++ mapping spec is simpler and it
+ avoids a lingering problem with Visual C++ and DLL exports with
+ templates.
+
+Fri Feb 2 02:54:02 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+
+ Added requires += cidl so that these projects will not be built if
+ cidl is not available.
+
+Thu Feb 1 19:00:50 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/CIAO.mwc:
+
+ Removed an unnecessary -includes.
+
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Receiver.mpc:
+
+ Removed requires += exceptions.
+
+Thu Feb 1 18:49:47 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * ChangeLogs/ChangeLog-1.4a:
+ * readme.txt:
+ * AMH/AMH.mpc:
+ * AMH_AMI/AMH_AMI.mpc:
+ * AMH_AMI/inner_cb.cpp:
+ * AMH_AMI/inner_cb.h:
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+ * EventServices/OMG_Basic/OMG_Basic.mpc:
+ * EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc:
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/OMG_TypedEC/Messenger_i.cpp:
+ * EventServices/OMG_TypedEC/Messenger_i.h:
+ * EventServices/OMG_TypedEC/OMG_TypedEC.mpc:
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+ * EventServices/RTEC_Basic/RTEC_Basic.mpc:
+ * EventServices/RTEC_Federated/RTEC_Federated.mpc:
+ * EventServices/RTEC_Filter/RTEC_Filter.mpc:
+ * EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.h:
+ * GettingStarted/GettingStarted.mpc:
+ * ImplRepo/ImplRepo.mpc:
+ * ImplRepo/Basic/ImplRepo_Basic.mpc:
+ * ImplRepo/IORTable/ImplRepo_IORTable.mpc:
+ * InterfaceRepo/IFRBrowser.cpp:
+ * InterfaceRepo/InterfaceRepo.mpc:
+ * LocalObjects/Messenger/Messenger.mpc:
+ * LocalObjects/ServantLocator/MessengerServer.cpp:
+ * LocalObjects/ServantLocator/ServantLocator.mpc:
+ * Messaging/AMIcallback/AMIcallback.mpc:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Messaging/AMIcallback/MessengerHandler.h:
+ * Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc:
+ * Multithreading/GracefulShutdown/GracefulShutdown.mpc:
+ * Multithreading/Reactive/Reactive.mpc:
+ * Multithreading/ThreadPerConnection/ThreadPerConnection.mpc:
+ * Multithreading/ThreadPool/ThreadPool.mpc:
+ * NamingService/Messenger/Messenger.mpc:
+ * NamingService/Naming_Client/Naming_Client.mpc:
+ * NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc:
+ * NamingService/Naming_Server/Naming_Server.mpc:
+ * NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc:
+ * NamingService/corbaname_Messenger/corbaname_Messenger.mpc:
+ * NotifyService/EventSequence/EventSequence.mpc:
+ * NotifyService/Filtering/Filtering.mpc:
+ * NotifyService/Messenger/Messenger.mpc:
+ * NotifyService/OfferSubscriptions/OfferSubscriptions.mpc:
+ * NotifyService/QoSProperties/QoSProperties.mpc:
+ * NotifyService/RTNotify/RTNotify.mpc:
+ * NotifyService/SupplierSideNC/SupplierSideNC.mpc:
+ * PortableInterceptors/Auth/Auth.mpc:
+ * PortableInterceptors/Auth/ClientInitializer.h:
+ * PortableInterceptors/Auth/ClientInterceptor.cpp:
+ * PortableInterceptors/Auth/ClientInterceptor.h:
+ * PortableInterceptors/Auth/ServerInitializer.h:
+ * PortableInterceptors/Auth/ServerInterceptor.cpp:
+ * PortableInterceptors/Auth/ServerInterceptor.h:
+ * PortableInterceptors/IOR/ClientInitializer.h:
+ * PortableInterceptors/IOR/ClientInterceptor.cpp:
+ * PortableInterceptors/IOR/ClientInterceptor.h:
+ * PortableInterceptors/IOR/IOR.mpc:
+ * PortableInterceptors/IOR/Messenger_i.cpp:
+ * PortableInterceptors/IOR/ServerInitializer.h:
+ * PortableInterceptors/IOR/ServerInterceptor.cpp:
+ * PortableInterceptors/IOR/ServerInterceptor.h:
+ * PortableInterceptors/PICurrent/ClientInitializer.h:
+ * PortableInterceptors/PICurrent/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent/PICurrent.mpc:
+ * PortableInterceptors/PICurrent/ServerInitializer.h:
+ * PortableInterceptors/PICurrent/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ServerInterceptor.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc:
+ * PortableInterceptors/PICurrent_NameService/ServerInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.h:
+ * PortableInterceptors/SimpleCodec/ClientInitializer.h:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.h:
+ * PortableInterceptors/SimpleCodec/Messenger_i.cpp:
+ * PortableInterceptors/SimpleCodec/ServerInitializer.h:
+ * PortableInterceptors/SimpleCodec/ServerInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ServerInterceptor.h:
+ * PortableInterceptors/SimpleCodec/SimpleCode.mpc:
+ * RTCORBA/RTCORBA.mpc:
+ * Security/ParticipatingApp/ParticipatingApp.mpc:
+ * Security/PolicyControllingApp/PolicyControllingApp.mpc:
+ * Security/SecurityUnawareApp/SecurityUnawareApp.mpc:
+ * SmartProxies/SmartProxies.mpc:
+ * ValueTypes/Bank/bank.mpc:
+ * ValueTypes/Bank/server.cpp:
+ * ValueTypes/Messenger/Message_i.cpp:
+ * ValueTypes/Messenger/ValueTypes.mpc:
+ * ValueTypes/Notify/Notify.mpc:
+
+ Brought over the TAO 1.4a DevGuideExamples and updated them for
+ TAO 1.5a.
diff --git a/TAO/DevGuideExamples/ChangeLogs/ChangeLog-1.4a b/TAO/DevGuideExamples/ChangeLogs/ChangeLog-1.4a
new file mode 100644
index 00000000000..9d8258884a5
--- /dev/null
+++ b/TAO/DevGuideExamples/ChangeLogs/ChangeLog-1.4a
@@ -0,0 +1,1932 @@
+Tue Jan 23 17:06:25 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Don't run examples that require threads if the ST configuration is
+ supplied.
+
+Tue Jan 23 17:00:34 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH/MessengerClient.cpp:
+ * AMH/MessengerServer.cpp:
+ * AMH_AMI/client.cpp:
+ * AMH_AMI/inner_cb.cpp:
+ * AMH_AMI/inner_server.cpp:
+ * AMH_AMI/middle_server.cpp:
+ * BiDirectionalGIOP/client.cpp:
+ * BiDirectionalGIOP/server.cpp:
+ * CIAO/Messenger/Administrator_Client.cpp:
+ * EventServices/OMG_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp:
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+ * GettingStarted/MessengerClient.cpp:
+ * GettingStarted/MessengerServer.cpp:
+ * ImplRepo/Basic/MessengerClient.cpp:
+ * ImplRepo/Basic/MessengerServer.cpp:
+ * ImplRepo/IORTable/MessengerClient.cpp:
+ * ImplRepo/IORTable/MessengerServer.cpp:
+ * ImplRepo/MessengerClient.cpp:
+ * ImplRepo/MessengerServer.cpp:
+ * InterfaceRepo/IFRBrowser.cpp:
+ * LocalObjects/Messenger/MessengerServer.cpp:
+ * LocalObjects/ServantLocator/MessengerClient.cpp:
+ * LocalObjects/ServantLocator/MessengerServer.cpp:
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Messaging/AMIcallback/MessengerServer.cpp:
+ * Messaging/RelativeRoundtripTimeout/MessengerClient.cpp:
+ * Messaging/RelativeRoundtripTimeout/MessengerServer.cpp:
+ * Multithreading/GracefulShutdown/MessengerClient.cpp:
+ * Multithreading/GracefulShutdown/MessengerServer.cpp:
+ * Multithreading/Reactive/MessengerClient.cpp:
+ * Multithreading/Reactive/MessengerServer.cpp:
+ * Multithreading/ThreadPerConnection/MessengerClient.cpp:
+ * Multithreading/ThreadPerConnection/MessengerServer.cpp:
+ * Multithreading/ThreadPool/MessengerClient.cpp:
+ * Multithreading/ThreadPool/MessengerServer.cpp:
+ * NamingService/Messenger/MessengerClient.cpp:
+ * NamingService/Messenger/MessengerServer.cpp:
+ * NamingService/Naming_Client/MessengerClient.cpp:
+ * NamingService/Naming_Client/MessengerServer.cpp:
+ * NamingService/Naming_Context_Ext/MessengerClient.cpp:
+ * NamingService/Naming_Context_Ext/MessengerServer.cpp:
+ * NamingService/Naming_Server/MessengerTask.cpp:
+ * NamingService/Naming_Server/NamingTask.cpp:
+ * NamingService/corbaloc_Messenger/MessengerClient.cpp:
+ * NamingService/corbaloc_Messenger/MessengerServer.cpp:
+ * NamingService/corbaname_Messenger/MessengerClient.cpp:
+ * NamingService/corbaname_Messenger/MessengerServer.cpp:
+ * NotifyService/EventSequence/MessengerClient.cpp:
+ * NotifyService/EventSequence/MessengerConsumer.cpp:
+ * NotifyService/EventSequence/MessengerServer.cpp:
+ * NotifyService/Filtering/MessengerClient.cpp:
+ * NotifyService/Filtering/MessengerConsumer.cpp:
+ * NotifyService/Filtering/MessengerServer.cpp:
+ * NotifyService/Filtering/Messenger_i.cpp:
+ * NotifyService/Messenger/MessengerClient.cpp:
+ * NotifyService/Messenger/MessengerConsumer.cpp:
+ * NotifyService/Messenger/MessengerServer.cpp:
+ * NotifyService/OfferSubscriptions/MessengerClient.cpp:
+ * NotifyService/OfferSubscriptions/MessengerConsumer.cpp:
+ * NotifyService/OfferSubscriptions/MessengerServer.cpp:
+ * NotifyService/QoSProperties/MessengerClient.cpp:
+ * NotifyService/QoSProperties/MessengerConsumer.cpp:
+ * NotifyService/QoSProperties/MessengerServer.cpp:
+ * NotifyService/RTNotify/MessengerClient.cpp:
+ * NotifyService/RTNotify/MessengerConsumer.cpp:
+ * NotifyService/RTNotify/MessengerServer.cpp:
+ * NotifyService/SupplierSideNC/MessengerClient.cpp:
+ * NotifyService/SupplierSideNC/MessengerConsumer.cpp:
+ * NotifyService/SupplierSideNC/MessengerServer.cpp:
+ * NotifyService/SupplierSideNC/MessengerSupplier.cpp:
+ * NotifyService/SupplierSideNC/Messenger_i.cpp:
+ * PortableInterceptors/Auth/ClientInitializer.cpp:
+ * PortableInterceptors/Auth/MessengerClient.cpp:
+ * PortableInterceptors/Auth/MessengerServer.cpp:
+ * PortableInterceptors/IOR/MessengerClient.cpp:
+ * PortableInterceptors/IOR/MessengerServer.cpp:
+ * PortableInterceptors/IOR/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerServer.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerClient.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerServer.cpp:
+ * PortableInterceptors/SimpleCodec/Messenger_i.cpp:
+ * RTCORBA/MessengerClient.cpp:
+ * RTCORBA/MessengerServer.cpp:
+ * Security/ParticipatingApp/MessengerClient.cpp:
+ * Security/ParticipatingApp/MessengerServer.cpp:
+ * Security/PolicyControllingApp/MessengerClient.cpp:
+ * Security/PolicyControllingApp/MessengerServer.cpp:
+ * Security/SecurityUnawareApp/MessengerClient.cpp:
+ * Security/SecurityUnawareApp/MessengerServer.cpp:
+ * SmartProxies/LoggerServer.cpp:
+ * SmartProxies/MessengerClient.cpp:
+ * SmartProxies/MessengerServer.cpp:
+ * ValueTypes/Bank/client.cpp:
+ * ValueTypes/Messenger/MessengerClient.cpp:
+ * ValueTypes/Notify/consumer.cpp:
+ * ValueTypes/Notify/supplier.cpp:
+
+ Catch exceptions as const.
+
+Tue Jan 23 13:16:24 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/OMG_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_Basic/EchoEventConsumer_i.h:
+ * EventServices/OMG_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+
+ Moved the disconnect_push_supplier() call to happen before the ORB
+ is shut down. There should be no communication related calls on
+ servants after shutdown() is called on the ORB.
+
+ * devguide_examples.lst:
+
+ Re-enabled the Security/ParticipatingApp example. It was
+ temporarily disabled in March of 2005, but runs properly now.
+
+ * devguide_client.mpb:
+ * devguide_example.mpb:
+ * devguide_server.mpb:
+
+ Removed these files. They were not used by any of the examples.
+
+Sat Dec 23 18:42:18 UTC 2006 Steve Totten <totten_s@ociweb.com>
+
+ * DevGuideExamples/NamingService/Naming_Server/Naming_Server.mpc:
+ Added "requires += threads" as this server
+ specifically calls activate on an ACE_Task. Thanks
+ to Rich Seibel <seibel_r@ociweb.com> for pointing
+ this out.
+
+Thu Aug 3 16:56:13 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+
+ Removed an unused parameter warning.
+
+Tue Aug 1 15:52:53 UTC 2006 Ciju John <johnc@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+
+ The host name part was being set incorrectly.
+
+Fri Jul 14 12:11:13 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.h:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+
+ Added an implementation for get_ip_address() which was added in
+ the commit to TAO 1.4a on Wed Jul 12 21:56:32 UTC 2006.
+
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+
+ If the TAO_ROOT environment variable isn't set, create it from
+ $ACE_ROOT/TAO.
+
+Fri Apr 21 16:16:46 2006 Ciju John <john_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Restored the RTEC_MCast_Federated to the nightly list.
+
+Fri Apr 21 16:00:01 2006 Ciju John <john_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated :
+
+ Restored the DevGuideExample deleted in entry
+ Fri Apr 7 15:30:11 2006 Ciju John <john_c@ociweb.com>
+
+Fri Apr 7 15:30:11 2006 Ciju John <john_c@ociweb.com>
+
+ * devguide_examples.lst
+
+ Commented out RTEC_MCast_Federated example.
+
+ * EventServices/RTEC_MCast_Federated
+
+ Remove DevGuide example.
+
+Tue Mar 7 13:11:30 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/OMG_Basic/OMG_Basic.mpc:
+ * EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc:
+ * EventServices/OMG_TypedEC/OMG_TypedEC.mpc:
+ * NamingService/Messenger/Messenger.mpc:
+ * NamingService/Naming_Client/Naming_Client.mpc:
+ * NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc:
+ * NamingService/Naming_Server/Naming_Server.mpc:
+ * NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc:
+ * NamingService/corbaname_Messenger/corbaname_Messenger.mpc:
+
+ Empty parent project names are no longer accepted (and ignored) by
+ MPC.
+
+Thu Feb 2 13:41:47 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Added the !NO_EXCEPTIONS to the RTCORBA example.
+
+Mon Jan 23 13:14:49 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * NotifyService/RTNotify/run_test.pl:
+
+ Increased the timeout for the messenger server for slower loading
+ machines.
+
+Mon Jan 23 06:28:43 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Modified to not run the InterfaceRepo test on a minimum corba
+ build.
+
+Fri Jan 20 06:39:59 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Modified the settings for
+ PortableInterceptors/PICurrent/run_test.pl by adding !MINIMUM as
+ is done for all of the other PortableInterceptors tests.
+
+ I also added !DISABLE_INTERCEPTORS to all the Security tests as
+ both the TAO_Security library and TAO_SSLIOP library require
+ interceptors.
+
+Tue Jan 17 09:00:33 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * InterfaceRepo/IFRBrowser.cpp:
+ * LocalObjects/Messenger/Messenger_i.h:
+ * PortableInterceptors/Auth/ClientInitializer.h:
+ * PortableInterceptors/Auth/ClientInterceptor.h:
+ * PortableInterceptors/IOR/ClientInitializer.h:
+ * PortableInterceptors/IOR/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent/ClientInitializer.h:
+ * PortableInterceptors/PICurrent/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.h:
+ * PortableInterceptors/SimpleCodec/ClientInitializer.h:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.h:
+ * ValueTypes/Messenger/MessengerClient.cpp:
+
+ Modified these files to use correct reference counting which
+ cleans up a few memory leaks.
+
+Fri Nov 18 14:56:08 USMST 2005 Yan Dai <dai_y@ociweb.com>
+
+ * DevGuideExamples/ValueTypes/Notify/supplier.cpp:
+ * DevGuideExamples/ValueTypes/Notify/run_test.pl:
+ * DevGuideExamples/ValueTypes/Notify/consumer.cpp:
+
+ Made the test create event channel instead of getting from
+ EventChannelFactory since current Notify_Service implementation
+ does not create a default event channel when -NoNameSvc is
+ specified.
+
+Wed Nov 9 14:54:08 2005 Don Busch <busch_d@ociweb.com>
+
+ * CIAO/Messenger/Administrator_Client.cpp
+ * CIAO/Messenger/Administrator_Client_IDL2.cpp
+ * CIAO/Messenger/Administrator_Client_IDL3.cpp
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc
+
+ Fixed both of these clients so they build properly
+ without conflicting with each other. The
+ Administrator_Client_IDL2.mpc client is a good example
+ of how to build an IDL3-to-IDL2 client.
+
+Fri Sep 23 14:54:08 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * AMH_AMI/middle_i.h:
+ * AMH_AMI/middle_i.cpp:
+
+ Changed a couple of passing parameter names to match the dev guide.
+
+Fri Sep 23 14:24:34 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * Multithreading/ThreadPerConnection/server.conf:
+
+ Corrected a typo.
+
+Fri Sep 23 14:17:29 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * InterfaceRepo/IFRBrowser.cpp:
+
+ Changed two variable types from unsigned int to CORBA::ULong.
+
+Fri Sep 23 14:08:19 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * NamingService/Naming_Server/NamingTask.h:
+
+ Changed the NamingTask to inherit from ACE_Task<ACE_MT_SYNCH>
+ since it is a two-threaded application.
+
+Fri Sep 23 13:58:13 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * NamingService/Messenger/MessengerClient.cpp:
+ * NamingService/Messenger/MessengerServer.cpp:
+
+ Changed to use more meaningful variable name and added
+ more comments to match the dev guide.
+
+Fri Sep 23 13:35:05 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+
+ Explicitly set the disjunction group be 1 to match
+ the dev guide.
+
+ * EventServices/RTEC_Basic/EchoEventSupplierMain.cpp:
+
+ Fixed a typo in a comment.
+
+Fri Sep 23 13:05:32 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * InterfaceRepo/IFRBrowser.cpp:
+
+ Added a default case to a switch statment
+ to match the dev guide.
+
+Fri Sep 23 12:42:31 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * ImplRepo/Basic/MessengerServer.cpp:
+
+ Changed the way of creating policy list to match the
+ dev guide.
+
+Fri Sep 23 10:33:04 2005 Chris Cleeland <cleeland_c@ociweb.com>
+
+ * AMH_AMI/inner_server.cpp:
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+ * NotifyService/SupplierSideNC/MessengerSupplier.cpp:
+
+ Fixed a few instance where the script I used to convert from
+ <ace/streams.h> to <iostream> left out a newline after the
+ changed line. This should fix compile problems on the
+ scoreboard.
+
+Fri Sep 23 02:22:38 2005 Steve Totten <totten_s@ociweb.com>
+
+ * ValueTypes/Messenger/MessengerClient.cpp:
+ * ImplRepo/IORTable/MessengerClient.cpp:
+ * ImplRepo/Basic/MessengerClient.cpp:
+
+ Added "CORBA::" to "is_nil()".
+
+Thu Sep 22 14:54:20 2005 Chris Cleeland <cleeland_c@ociweb.com>
+
+ I think it would have been easier to list the files that didn't
+ change...
+
+ * AMH/AMH.mpc:
+ * AMH_AMI/AMH_AMI.mpc:
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Receiver.mpc:
+ * EventServices/OMG_Basic/OMG_Basic.mpc:
+ * EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc:
+ * EventServices/OMG_TypedEC/OMG_TypedEC.mpc:
+ * EventServices/RTEC_Basic/RTEC_Basic.mpc:
+ * EventServices/RTEC_Federated/RTEC_Federated.mpc:
+ * EventServices/RTEC_Filter/RTEC_Filter.mpc:
+ * EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc:
+ * GettingStarted/GettingStarted.mpc:
+ * ImplRepo/Basic/ImplRepo_Basic.mpc:
+ * ImplRepo/IORTable/ImplRepo_IORTable.mpc:
+ * ImplRepo/ImplRepo.mpc:
+ * InterfaceRepo/InterfaceRepo.mpc:
+ * LocalObjects/Messenger/Messenger.mpc:
+ * LocalObjects/ServantLocator/ServantLocator.mpc:
+ * Messaging/AMIcallback/AMIcallback.mpc:
+ * Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc:
+ * Multithreading/GracefulShutdown/GracefulShutdown.mpc:
+ * Multithreading/Reactive/Reactive.mpc:
+ * Multithreading/ThreadPerConnection/ThreadPerConnection.mpc:
+ * Multithreading/ThreadPool/ThreadPool.mpc:
+ * NamingService/Messenger/Messenger.mpc:
+ * NamingService/Naming_Client/Naming_Client.mpc:
+ * NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc:
+ * NamingService/Naming_Server/Naming_Server.mpc:
+ * NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc:
+ * NamingService/corbaname_Messenger/corbaname_Messenger.mpc:
+ * NotifyService/EventSequence/EventSequence.mpc:
+ * NotifyService/Filtering/Filtering.mpc:
+ * NotifyService/Messenger/Messenger.mpc:
+ * NotifyService/OfferSubscriptions/OfferSubscriptions.mpc:
+ * NotifyService/QoSProperties/QoSProperties.mpc:
+ * NotifyService/RTNotify/RTNotify.mpc:
+ * NotifyService/SupplierSideNC/SupplierSideNC.mpc:
+ * PortableInterceptors/Auth/Auth.mpc:
+ * PortableInterceptors/IOR/IOR.mpc:
+ * PortableInterceptors/PICurrent/PICurrent.mpc:
+ * PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc:
+ * PortableInterceptors/SimpleCodec/SimpleCode.mpc:
+ * RTCORBA/RTCORBA.mpc:
+ * Security/ParticipatingApp/ParticipatingApp.mpc:
+ * Security/PolicyControllingApp/PolicyControllingApp.mpc:
+ * Security/SecurityUnawareApp/SecurityUnawareApp.mpc:
+ * SmartProxies/SmartProxies.mpc:
+ * ValueTypes/Bank/bank.mpc:
+ * ValueTypes/Messenger/ValueTypes.mpc:
+ * ValueTypes/Notify/Notify.mpc:
+
+ Removed reference to the devguide_server and devguide_client
+ base projects. Since one of the goals for our dev guide
+ examples is to provide hallmark examples of how to write code
+ and projects, and we document the mpc files in the book itself,
+ it didn't seem correct to use base projects that the user
+ herself would not end up using.
+
+ Note that if we decide, at some point, to add an example of
+ creating your own base project to the MPC chapter, we could then
+ re-introduce devguide-specific base projects.
+
+ * AMH/AMH_Messenger_i.cpp:
+ * AMH/MessengerClient.cpp:
+ * AMH/MessengerServer.cpp:
+ * AMH/Messenger_i.cpp:
+
+ * AMH_AMI/client.cpp:
+ * AMH_AMI/inner_cb.cpp:
+ * AMH_AMI/inner_server.cpp:
+ * AMH_AMI/middle_i.cpp:
+ * AMH_AMI/middle_server.cpp:
+
+ * BiDirectionalGIOP/server.cpp:
+
+ * EventServices/OMG_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_Basic/EchoEventSupplierMain.cpp:
+
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp:
+
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/OMG_TypedEC/Messenger_i.cpp:
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplierMain.cpp:
+
+ * EventServices/RTEC_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+
+ * EventServices/RTEC_Filter/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplierMain.cpp:
+
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ * GettingStarted/MessengerClient.cpp:
+ * GettingStarted/MessengerServer.cpp:
+ * GettingStarted/Messenger_i.cpp:
+
+ * ImplRepo/Basic/MessengerClient.cpp:
+ * ImplRepo/Basic/MessengerServer.cpp:
+ * ImplRepo/Basic/Messenger_i.cpp:
+
+ * ImplRepo/IORTable/MessengerClient.cpp:
+ * ImplRepo/IORTable/MessengerServer.cpp:
+ * ImplRepo/IORTable/Messenger_i.cpp:
+
+ * ImplRepo/MessengerClient.cpp:
+ * ImplRepo/MessengerServer.cpp:
+ * ImplRepo/Messenger_i.cpp:
+
+
+ * LocalObjects/Messenger/MessengerServer.cpp:
+
+ * LocalObjects/ServantLocator/MessengerClient.cpp:
+ * LocalObjects/ServantLocator/MessengerServer.cpp:
+ * LocalObjects/ServantLocator/Messenger_i.cpp:
+
+ * Messaging/AMIcallback/Messenger.idl:
+ * Messaging/AMIcallback/MessengerHandler.h:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Messaging/AMIcallback/MessengerServer.cpp:
+ * Messaging/AMIcallback/Messenger_i.h:
+ * Messaging/AMIcallback/Messenger_i.cpp:
+
+ * Messaging/RelativeRoundtripTimeout/MessengerClient.cpp:
+ * Messaging/RelativeRoundtripTimeout/MessengerServer.cpp:
+
+ * Multithreading/GracefulShutdown/MessengerClient.cpp:
+ * Multithreading/GracefulShutdown/MessengerServer.cpp:
+ * Multithreading/GracefulShutdown/Messenger_i.cpp:
+
+ * Multithreading/Reactive/MessengerClient.cpp:
+ * Multithreading/Reactive/MessengerServer.cpp:
+ * Multithreading/Reactive/Messenger_i.cpp:
+
+ * Multithreading/ThreadPerConnection/MessengerClient.cpp:
+ * Multithreading/ThreadPerConnection/MessengerServer.cpp:
+ * Multithreading/ThreadPerConnection/Messenger_i.cpp:
+
+ * Multithreading/ThreadPool/MessengerClient.cpp:
+ * Multithreading/ThreadPool/MessengerServer.cpp:
+ * Multithreading/ThreadPool/Messenger_i.cpp:
+
+ * NamingService/Messenger/MessengerClient.cpp:
+ * NamingService/Messenger/MessengerServer.cpp:
+ * NamingService/Messenger/Messenger_i.cpp:
+
+ * NamingService/Naming_Client/MessengerClient.cpp:
+ * NamingService/Naming_Client/MessengerServer.cpp:
+ * NamingService/Naming_Client/Messenger_i.cpp:
+
+ * NamingService/Naming_Context_Ext/MessengerClient.cpp:
+ * NamingService/Naming_Context_Ext/MessengerServer.cpp:
+ * NamingService/Naming_Context_Ext/Messenger_i.cpp:
+
+ * NamingService/Naming_Server/Messenger_i.cpp:
+
+ * NamingService/corbaloc_Messenger/MessengerClient.cpp:
+ * NamingService/corbaloc_Messenger/MessengerServer.cpp:
+ * NamingService/corbaloc_Messenger/Messenger_i.cpp:
+
+ * NamingService/corbaname_Messenger/MessengerClient.cpp:
+ * NamingService/corbaname_Messenger/MessengerServer.cpp:
+ * NamingService/corbaname_Messenger/Messenger_i.cpp:
+
+ * NotifyService/EventSequence/MessengerClient.cpp:
+ * NotifyService/EventSequence/MessengerServer.cpp:
+
+ * NotifyService/Filtering/MessengerClient.cpp:
+ * NotifyService/Filtering/MessengerServer.cpp:
+
+ * NotifyService/Messenger/MessengerClient.cpp:
+ * NotifyService/Messenger/MessengerServer.cpp:
+
+ * NotifyService/OfferSubscriptions/MessengerClient.cpp:
+ * NotifyService/OfferSubscriptions/MessengerServer.cpp:
+
+ * NotifyService/QoSProperties/MessengerClient.cpp:
+ * NotifyService/QoSProperties/MessengerServer.cpp:
+
+ * NotifyService/RTNotify/MessengerClient.cpp:
+ * NotifyService/RTNotify/MessengerServer.cpp:
+
+ * NotifyService/SupplierSideNC/MessengerClient.cpp:
+ * NotifyService/SupplierSideNC/MessengerServer.cpp:
+ * NotifyService/SupplierSideNC/MessengerSupplier.cpp:
+
+ * PortableInterceptors/Auth/MessengerClient.cpp:
+ * PortableInterceptors/Auth/MessengerServer.cpp:
+
+ * PortableInterceptors/IOR/MessengerClient.cpp:
+ * PortableInterceptors/IOR/MessengerServer.cpp:
+ * PortableInterceptors/IOR/Messenger_i.cpp:
+ * PortableInterceptors/IOR/ServerIORInterceptor.cpp:
+
+ * PortableInterceptors/PICurrent/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent/run_test.pl:
+
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerServer.cpp:
+
+ * PortableInterceptors/SimpleCodec/MessengerClient.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerServer.cpp:
+ * PortableInterceptors/SimpleCodec/Messenger_i.cpp:
+
+ * RTCORBA/MessengerClient.cpp:
+ * RTCORBA/MessengerServer.cpp:
+ * RTCORBA/Messenger_i.cpp:
+
+ * Security/ParticipatingApp/MessengerServer.cpp:
+ * Security/ParticipatingApp/Messenger_i.cpp:
+
+ * Security/PolicyControllingApp/MessengerClient.cpp:
+ * Security/PolicyControllingApp/MessengerServer.cpp:
+ * Security/PolicyControllingApp/Messenger_i.cpp:
+
+ * Security/SecurityUnawareApp/MessengerClient.cpp:
+ * Security/SecurityUnawareApp/MessengerServer.cpp:
+ * Security/SecurityUnawareApp/Messenger_i.cpp:
+
+ * SmartProxies/LoggerServer.cpp:
+ * SmartProxies/MessengerClient.cpp:
+ * SmartProxies/MessengerServer.cpp:
+ * SmartProxies/Messenger_i.cpp:
+
+ * ValueTypes/Bank/client.cpp:
+ * ValueTypes/Bank/server.cpp:
+
+ * ValueTypes/Messenger/Message_i.cpp:
+ * ValueTypes/Messenger/MessengerClient.cpp:
+ * ValueTypes/Messenger/MessengerServer.cpp:
+ * ValueTypes/Messenger/Messenger_i.h:
+ * ValueTypes/Messenger/Messenger_i.cpp:
+
+ * ValueTypes/Notify/Event_i.h:
+ * ValueTypes/Notify/consumer.cpp:
+ * ValueTypes/Notify/supplier.cpp:
+
+ General synchronization of actual source code with code
+ published in the book. Sometimes the book's expresion of
+ the idea won, while sometimes others won. In places where
+ the code remains different, it's because the differences
+ didn't lend substantially to the educational value of the
+ example in the book, but lent significantly to the efficacy
+ of the actual code.
+
+ Now that the world seems to have caught up to standards, I
+ replaced ACE_ASSERT() usage with throwing exceptions defined
+ the C++ standard, and changed usage of ACE's streams to use
+ the actual standard streams.
+
+ Removed "using namespace..." shorthand syntax, as this also
+ conflicts with the idea that the code should be consistent
+ between the book and the actual code.
+
+Wed Sep 14 08:46:46 2005 Justin Michel <michel_j@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Missing ':' between test and config options.
+
+Tue Sep 13 10:31:23 2005 Justin Michel <michel_j@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Prevent the tests from running for exceptions=0 builds.
+
+Wed Aug 31 17:12:59 2005 Chris Cleeland <cleeland_c@ociweb.com>
+
+ * Security/ParticipatingApp/MessengerServer.cpp:
+ * Security/ParticipatingApp/Messenger_i.h:
+ * Security/ParticipatingApp/Messenger_i.cpp:
+
+ Removed references to now-obsolete SecurityLevel1 and
+ SecurityLevel2 "Current" objects.
+
+ * Security/ParticipatingApp/ParticipatingApp.mpc:
+ * Security/PolicyControllingApp/PolicyControllingApp.mpc:
+
+ Updated to use the ssliop base project.
+
+Wed Aug 31 12:03:40 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * BiDirectionalGIOP/bidir_giop_pch.cpp:
+
+ Added a pch cpp file since vc8 requires it in order to use
+ precompiled headers.
+
+Wed Aug 31 11:30:49 2005 Justin Michel <michel_j@ociweb.com>
+
+ * SmartProxies/SmartProxies.mpc:
+
+ One of the projects was incorrectly compiling IDL, which caused
+ a problem on nmake builds. Other platforms worked due to the
+ random order in which projects are built.
+
+Wed Aug 24 16:46:13 2005 Justin Michel <michel_j@ociweb.com>
+
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+
+ Changed the project to derive from ciao_client. This simplifies the mpc, and
+ prevents the project from being built when ciao is disabled.
+
+Wed Aug 24 12:52:02 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * CIAO/Messenger/descriptors/run_test.pl:
+
+ Delete one redundant line for creating CIAO_ROOT variable.
+
+Wed Aug 24 12:22:56 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * CIAO/Messenger/Administrator_Client.cpp:
+ * CIAO/Messenger/Administrator_Client_IDL2.mpc:
+ * CIAO/Messenger/Administrator_Client_IDL3.mpc:
+
+ This is to test the tao_idl3_to_idl2 compiler. Don Busch provided
+ the three files. I made some changes to Administrator_Client_IDL2.mpc
+ to let it work within CIAO.
+
+ * CIAO/Messenger/Administrator_exec_i.cpp:
+
+ Added an EXIT option to the interactive user interface.
+
+ * CIAO/Messenger/descriptors/ApplicationNodeMap.dat:
+
+ Changed port number. There was a confliction of use of port number
+ 10000 in my system. Now I changed it to 11000 (22000,33000,44000).
+
+ * CIAO/Messenger/descriptors/admin.dat:
+
+ This file contains the input data for I/O redirection.
+
+ * CIAO/Messenger/descriptors/run_test.pl:
+
+ Add this perl script to automatically test this example.
+
+ For more information, please refer to [RT 5889].
+
+Wed Aug 17 14:18:54 2005 Steve Totten <totten_s@ociweb.com>
+
+ * readme.txt:
+ Added instructions for generating solution/project files for vc71.
+
+Tue Aug 2 07:48:22 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * ValueTypes/Bank/bank.mpc:
+ * ValueTypes/Bank/server.cpp:
+
+ Fixed build errors due to incorrect 'after' usage and missing
+ throw specs.
+
+Mon Aug 1 16:40:04 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ValueTypes/Bank/README:
+ * ValueTypes/Bank/_pch.h:
+ * ValueTypes/Bank/_pch.cpp:
+ * ValueTypes/Bank/bank.idl:
+ * ValueTypes/Bank/bank.mpc:
+ * ValueTypes/Bank/client.cpp:
+ * ValueTypes/Bank/run_test.pl:
+ * ValueTypes/Bank/server.cpp:
+
+ A new example that's simpler than the Messenger example
+ in some ways.
+
+ * ValueTypes/Messenger/Message_i.h:
+ * ValueTypes/Messenger/Message_i.cpp:
+ * ValueTypes/Messenger/Messenger.idl:
+ * ValueTypes/Messenger/MessengerClient.cpp:
+ * ValueTypes/Messenger/MessengerServer.cpp:
+
+ Removed use of factory, as this functionality is now
+ demonstrated with the Bank example.
+
+ * ValueTypes/Notify/Event.idl:
+ * ValueTypes/Notify/Event_i.h:
+ * ValueTypes/Notify/consumer.cpp:
+ * ValueTypes/Notify/supplier.cpp:
+
+ Removed some exception macros.
+ Use ACE_DEBUG instead of cout for better multithreading/multiprocess
+ behavior.
+
+ * devguide_examples.lst:
+
+ Added the Bank example.
+
+Mon Aug 1 15:45:11 2005 Wallace Zhang <zhang_w@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Enable the EventServices/OMG_TypedEC/run_test.pl
+
+Wed Jul 27 12:50:45 2005 Justin Michel <michel_j@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Add the new example to the list.
+
+Wed Jul 27 12:38:01 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ValueTypes/Notify/Event.idl:
+ * ValueTypes/Notify/Event_i.h:
+ * ValueTypes/Notify/Notify.mpc:
+ * ValueTypes/Notify/consumer.cpp:
+ * ValueTypes/Notify/notify.conf:
+ * ValueTypes/Notify/readme.txt:
+ * ValueTypes/Notify/run_test.pl:
+ * ValueTypes/Notify/supplier.cpp:
+
+ A new example, showing how to use valuetypes with the
+ notification service.
+
+Mon Jul 25 09:21:31 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH/AMH_Messenger_i.cpp:
+
+ Use the inout() method on the String_var.
+
+Mon Jul 18 12:01:17 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * SmartProxies/MessengerClient.cpp:
+
+ Added a catch for ... since a constructor can throw an integer
+ exception.
+
+ * SmartProxies/SmartProxies.mpc:
+
+ Updated to remove smart_proxies from the LoggerServer project and
+ ensure that the client is built after the server and the logger.
+
+Wed Jul 6 10:40:42 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/OMG_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_TypedEC/Consumer_i.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp:
+ * ImplRepo/IORTable/MessengerServer.cpp:
+ * ImplRepo/MessengerServer.cpp:
+ * LocalObjects/ServantLocator/MessengerLocator_i.h:
+ * NotifyService/EventSequence/EventSequenceConsumer_i.cpp:
+ * NotifyService/EventSequence/EventSequenceSupplier_i.cpp:
+ * NotifyService/Filtering/StructuredEventConsumer_i.cpp:
+ * NotifyService/Filtering/StructuredEventSupplier_i.cpp:
+ * NotifyService/Messenger/StructuredEventConsumer_i.cpp:
+ * NotifyService/Messenger/StructuredEventSupplier_i.cpp:
+ * NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp:
+ * NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp:
+ * NotifyService/QoSProperties/StructuredEventConsumer_i.cpp:
+ * NotifyService/QoSProperties/StructuredEventSupplier_i.cpp:
+ * NotifyService/RTNotify/StructuredEventConsumer_i.cpp:
+ * NotifyService/RTNotify/StructuredEventSupplier_i.cpp:
+ * NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp:
+ * NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp:
+
+ Modifications to go along with the skeleton refactoring merge.
+
+Tue May 31 15:19:38 2005 Chris Cleeland <cleeland_c@ociweb.com>
+
+ * Security/ParticipatingApp/MessengerClient.cpp:
+
+ Added line continuation characters into the strings in the
+ sample service configuration files. Without them, some
+ preprocessors were getting confused.
+
+ * Security/ParticipatingApp/run_test.pl:
+
+ Increased the time to wait for the IOR file to show up.
+
+Tue May 10 10:15:40 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ImplRepo/IORTable/MessengerServer.cpp:
+
+ Missing .in() on String_vars causes warnings on some compilers.
+
+Fri May 6 09:21:37 2005 Justin Michel <michel_j@ociweb.com>
+
+ * CIAO/CIAO.mwc:
+ * CIAO/Messenger/Messenger.mwc:
+
+ Removed unwanted vcproj, sln, and mwc files.
+ Added a new ciao feature to allow disabling all CIAO mpc generation.
+
+Fri Apr 29 10:20:17 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+
+ Add a separate ORB thread to this test to avoid deadlocks between
+ the two supplier processes.
+
+Thu Apr 28 10:30:17 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Remove separate ORB thread as it is no longer needed.
+
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+
+ Modify test to remove redirection as it was causing the EchoEventSuppliers
+ to not be killed. Also changed the ports to random ports to avoid collisions.
+
+Wed Apr 27 15:20:58 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Clean up this file for the new devguide.
+
+Mon Apr 25 15:24:51 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_MCast_Federated/README:
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+
+ Improve the timing of this test. It was previously based on sleep()
+ calls in the perl script and supplier code.
+
+Mon Apr 25 14:04:35 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_Federated/run_test.pl:
+ * EventServices/RTEC_Federated/supplier.conf:
+
+ Try to alleviate some deadlocking issues with IIOP Gateway on
+ some platforms.
+
+Fri Apr 22 11:56:42 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+
+ Another compiler warning removed.
+
+Fri Apr 22 11:51:20 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/Consumer_i.cpp:
+
+ Get rid of unused parameter warning.
+
+Fri Apr 22 09:55:58 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Federated/README:
+ * EventServices/RTEC_Federated/run_test.pl:
+
+ Fix this example so that it actually federates event channels.
+
+Thu Apr 21 21:28:42 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+
+ * EventServices/OMG_Basic/ExceptionUtil.h:
+ * EventServices/OMG_SupplierSideEC/ExceptionUtil.h:
+ * EventServices/RTEC_Basic/ExceptionUtil.h:
+ * EventServices/RTEC_Federated/ExceptionUtil.h:
+ * EventServices/RTEC_Filter/ExceptionUtil.h:
+ * EventServices/RTEC_MCast_Federated/ExceptionUtil.h:
+
+ Removed these unused files.
+
+Thu Apr 21 21:17:48 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/OMG_TypedEC/Consumer_i.h:
+ * EventServices/OMG_TypedEC/Consumer_i.cpp:
+ * EventServices/OMG_TypedEC/Messenger.idl:
+ * EventServices/OMG_TypedEC/Messenger_i.h:
+ * EventServices/OMG_TypedEC/Messenger_i.cpp:
+ * EventServices/OMG_TypedEC/README:
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+
+ Cosmetic updates for DevGuide.
+
+Thu Apr 21 15:37:43 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/README:
+
+ Convert commands to use *IOR environment variables.
+
+Thu Apr 21 14:56:15 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/README:
+
+ Add a README for this example.
+
+Thu Apr 21 13:43:58 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_TypedEC/ConsumerMain.cpp:
+ * EventServices/OMG_TypedEC/Consumer_i.h:
+ * EventServices/OMG_TypedEC/Consumer_i.cpp:
+ * EventServices/OMG_TypedEC/Messenger.idl:
+ * EventServices/OMG_TypedEC/Messenger_i.h:
+ * EventServices/OMG_TypedEC/Messenger_i.cpp:
+ * EventServices/OMG_TypedEC/OMG_TypedEC.mpc:
+ * EventServices/OMG_TypedEC/SupplierMain.cpp:
+ * EventServices/OMG_TypedEC/run_test.pl:
+
+ Add a new example using typed event channels.
+
+Wed Apr 20 15:22:14 2005 Don Busch <busch_d@ociweb.com>
+
+ * Messaging/AMIcallback/MessengerServer.cpp:
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+
+ Added std:: prefix to cout, cerr, endl.
+ Changed message.inout() to message.in() in client.
+ Changed exception handlling to use try/catch and orb->shutdown() in
+ MessengerHandler to correct error.
+
+ * Messaging/RelativeRoundtripTimeout/MessengerClient.cpp:
+
+ Changed SET/ADD_OVERRIDE usage to match DevGuide
+
+Fri Apr 15 12:30:02 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * EventServices/OMG_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Rename naming_client variables for readability.
+
+Tue Apr 5 06:48:00 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * ImplRepo/Basic/Messenger_i.h:
+ * ImplRepo/Basic/Messenger_i.cpp:
+ * ImplRepo/IORTable/Messenger_i.h:
+ * ImplRepo/IORTable/Messenger_i.cpp:
+
+ Added throw specs to match the base class.
+
+Mon Apr 4 15:54:56 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ImplRepo/Activator/run_test.pl:
+ * ImplRepo/Basic/ImplRepo_Basic.mpc:
+ * ImplRepo/Basic/Messenger.idl:
+ * ImplRepo/Basic/MessengerClient.cpp:
+ * ImplRepo/Basic/MessengerServer.cpp:
+ * ImplRepo/Basic/Messenger_i.h:
+ * ImplRepo/Basic/Messenger_i.cpp:
+ * ImplRepo/Basic/run_test.pl:
+ * ImplRepo/IORTable/ImplRepo_IORTable.mpc:
+ * ImplRepo/IORTable/Messenger.idl:
+ * ImplRepo/IORTable/MessengerClient.cpp:
+ * ImplRepo/IORTable/MessengerServer.cpp:
+ * ImplRepo/IORTable/Messenger_i.h:
+ * ImplRepo/IORTable/Messenger_i.cpp:
+ * ImplRepo/IORTable/run_test.pl:
+
+ Add samples corresponding to the new devguide ImR chapter.
+
+Fri Apr 1 08:55:43 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Added a !NO_IFR configuration to the IFR related test.
+ The IFR_Service will not run on MacOS X unless TAO is built
+ statically due to gcc's in ability to deal with template
+ instantiated singletons correctly.
+
+Thu Mar 31 13:18:21 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * NotifyService/RTNotify/Messenger.idl:
+ * NotifyService/RTNotify/MessengerClient.cpp:
+ * NotifyService/RTNotify/MessengerConsumer.cpp:
+ * NotifyService/RTNotify/MessengerServer.cpp:
+ * NotifyService/RTNotify/Messenger_i.h:
+ * NotifyService/RTNotify/Messenger_i.cpp:
+ * NotifyService/RTNotify/Priorities.h:
+ * NotifyService/RTNotify/README:
+ * NotifyService/RTNotify/RTNotify.mpc:
+ * NotifyService/RTNotify/StructuredEventConsumer_i.h:
+ * NotifyService/RTNotify/StructuredEventConsumer_i.cpp:
+ * NotifyService/RTNotify/StructuredEventSupplier_i.h:
+ * NotifyService/RTNotify/StructuredEventSupplier_i.cpp:
+ * NotifyService/RTNotify/notify.conf:
+ * NotifyService/RTNotify/nsclient.conf:
+ * NotifyService/RTNotify/run_test.pl:
+ * devguide_examples.lst:
+
+ Add a a new DevGuide example for RT Notification.
+
+Wed Mar 30 07:59:23 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * ValueTypes/Messenger/run_test.pl:
+
+ Increase the timeout for slower machines.
+
+Wed Mar 30 11:04:12 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ImplRepo/MessengerServer.cpp:
+
+ Update all examples to use _tao_poa_downcast() instead of
+ RTTI, because I think it's slightly easier to read. Note: The files
+ still have to include tao/PortableServer/POA.h.
+
+Tue Mar 29 17:07:14 2005 Justin Michel <michel_j@ociweb.com>
+
+ * ImplRepo/MessengerServer.cpp:
+ * ImplRepo/run_test.pl:
+
+ Many fixes and some minor new features in the ImR.
+ Eliminates most of the known bugs and design flaws.
+ PER_CLIENT activation now works correctly.
+ Added a new version of id_to_reference() to TAO_POA that takes
+ an additional parameter to allow specifying direct or indirect
+ binding.
+
+Tue Mar 29 10:28:24 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Clone the endpoint before passing it to the
+ TAO_ECG_UDP_{Sender,Receiver}::init() method.
+
+Mon Mar 28 09:18:54 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Receiver.mpc:
+
+ Added the *_svnt libraries to the *_exec projects.
+
+Mon Mar 28 08:44:59 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * NotifyService/SupplierSideNC/Messenger_i.cpp:
+
+ The static initialization trick doesn't work with static builds
+ either.
+
+Mon Mar 28 08:22:09 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Temporarily disable the ParticipatingApp Security example until it
+ is re-written.
+
+Mon Mar 28 07:49:32 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ The RTCORBA example does not run in static builds.
+
+Mon Mar 28 07:46:13 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * NotifyService/SupplierSideNC/Messenger_i.cpp:
+
+ Added an include of the CosNotification library initializer header
+ to work around static construction issues on SunOS and MacOS X.
+
+ * NotifyService/SupplierSideNC/run_test.pl:
+
+ Removed a Kill() call on a non-existent Process Object.
+
+Mon Mar 28 07:29:00 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * NamingService/Naming_Context_Ext/run_test.pl:
+ * NamingService/corbaname_Messenger/run_test.pl:
+
+ Wait for the ns ior file to avoid timing issues.
+
+ * Security/ParticipatingApp/run_test.pl:
+
+ Use the right Process object when killing the server.
+
+Fri Mar 25 08:45:55 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * ImplRepo/run_test.pl:
+
+ Increased the timeout for the implrepo.ior.
+
+Fri Mar 25 08:16:15 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * devguide_examples.lst:
+
+ Added a list that can be used with auto_run_tests.pl.
+ We can maintain this separately from the other test lists and
+ bring it forward to new releases of TAO.
+
+Fri Mar 25 06:15:27 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * Security/ParticipatingApp/Messenger_i.cpp:
+
+ Added #include of ace/OS_NS_string.h to get ACE_OS::memcpy.
+
+Fri Mar 18 10:43:38 2005 Paul Calabrese <calabrese_p@ociweb.com>
+
+ * NotifyService/EventSequence/run_test.pl:
+ * NotifyService/Filtering/MessengerConsumer.cpp:
+ * NotifyService/Filtering/run_test.pl:
+ * NotifyService/Messenger/MessengerServer.cpp:
+ * NotifyService/Messenger/Messenger_i.cpp:
+ * NotifyService/Messenger/StructuredEventConsumer_i.h:
+ * NotifyService/Messenger/StructuredEventSupplier_i.h:
+ * NotifyService/Messenger/run_test.pl:
+ * NotifyService/OfferSubscriptions/MessengerServer.cpp:
+ * NotifyService/OfferSubscriptions/run_test.pl:
+ * NotifyService/QoSProperties/run_test.pl:
+ * NotifyService/SupplierSideNC/MessengerConsumer.cpp:
+ * NotifyService/SupplierSideNC/MessengerServer.cpp:
+ * NotifyService/SupplierSideNC/run_test.pl:
+
+ Clean up the examples including:
+ - Fix problems with the run_test.pl scripts
+ - Enforce some consistency across these examples
+ - Make some changes to more directly reflect the code in the DevGuide
+ - Fix some spelling errors
+ - Remove some unneeded code
+
+Thu Mar 17 09:02:18 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Messenger_exec_i.cpp:
+
+ Reordered the initialization list to avoid build warnings from
+ gcc.
+
+Mon Mar 7 07:26:00 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * Messaging/AMIcallback/AMIcallback.mpc:
+
+ Work around the internal compiler error on Linux Itanium with g++
+ 2.96.
+
+Fri Mar 4 06:22:14 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Receiver_exec_i.cpp:
+
+ Added a missing n to make a \n.
+
+Thu Mar 3 06:34:44 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/History_exec_i.h:
+
+ Added a space between < and :: to avoid build problems with gcc
+ 3.4.2, again.
+
+Tue Mar 1 06:19:43 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Receiver.mpc:
+
+ Made this project require 'cidl'.
+
+Mon Feb 28 11:05:34 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/History_exec.h:
+
+ Added a space between < and :: to avoid build problems with gcc
+ 3.4.2.
+
+Mon Feb 28 08:35:04 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Administrator.mpc:
+ * CIAO/Messenger/Messenger.mpc:
+ * CIAO/Messenger/Receiver.mpc:
+
+ Made these projects require 'cidl'.
+
+Mon Feb 28 06:21:01 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * CIAO/Messenger/Messenger.mwc:
+
+ Removed this file. It is not a valid mwc file and does not
+ provide the necessary include paths even if it were valid.
+
+Fri Feb 18 11:51:44 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH_AMI/AMH_AMI.mpc:
+
+ Added a 'verbatim' section to set the VDIR for the gnuace project
+ type. This will alleviate link errors due to implicit template
+ instantiation deficiencies.
+
+Tue Feb 15 07:01:41 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH_AMI/AMH_AMI.mpc:
+
+ Corrected build ordering and added an empty IDL_Files section for
+ the client.
+
+ * AMH_AMI/middle_i.cpp:
+
+ Removed build warnings from gcc.
+
+Tue Feb 15 06:22:53 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH_AMI/AMH_AMI.mpc:
+ * AMH_AMI/amh_ami_pch.h:
+ * AMH_AMI/inner_cb.cpp:
+
+ Fixed precompiled header compile problems.
+
+Mon Feb 14 16:47:12 2005 Steve Totten <totten_s@ociweb.com>
+
+ * AMH_AMI/AMH_AMI.mpc:
+ * NamingService/corbaname_Messenger/corbaname_Messenger.mpc:
+ Fixed clash between duplicate case-insensitive project names
+ "client" in these two project files because they appear in
+ the same workspace (DevGuideExamples.mwc). Used the
+ wildcard "*" in all the project names to make sure they are
+ unique.
+
+Mon Feb 14 13:21:51 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * AMH_AMI/*:
+
+ A new example for the AMH chapter of the devguide. This is a
+ duplicate log entry for the TAO/OCIChangeLog tag:
+ Mon Feb 14 11:25:15 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+
+Mon Feb 14 11:25:15 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * AMH_AMI/*:
+
+ This is a new example used to reinforce concepts in the new AMH
+ chapter of the dev guide.
+
+Fri Feb 4 08:47:10 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/Messenger_i.cpp:
+
+ Changed OS_NS_time.h to OS_NS_sys_time.h.
+
+Thu Feb 3 07:42:31 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp:
+ * LocalObjects/ServantLocator/MessengerLocator_i.cpp:
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/Messenger_i.cpp:
+ * Messaging/RelativeRoundtripTimeout/Messenger_i.cpp:
+ * NamingService/Naming_Server/NamingTask.cpp:
+ * NotifyService/Messenger/Messenger_i.cpp:
+ * PortableInterceptors/Auth/ClientInterceptor.cpp:
+ * PortableInterceptors/Auth/ServerInterceptor.cpp:
+ * PortableInterceptors/IOR/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/Messenger_i.cpp:
+
+ Added various ACE includes for non-debug windows builds.
+
+Wed Feb 2 13:35:36 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH/amh_pch.h:
+ * BiDirectionalGIOP/bidir_giop_pch.h:
+ * GettingStarted/started_pch.h:
+ * ValueTypes/Messenger/_pch.h:
+
+ Removed tao/Invocation.h from these precompiled header files.
+
+Fri Jan 21 07:00:42 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * AMH/AMH.mpc:
+
+ The client project doesn't really require AMH, but since the
+ server and client are in the same directory and share the
+ generated idl code it has to inherit from amh.
+
+Wed Jan 19 15:46:42 MST 2005 Trevor Fields <fields_t@ociweb.com>
+
+ * BiDirectionalGIOP/callback_i.cpp:
+ * BiDirectionalGIOP/client.cpp:
+ * BiDirectionalGIOP/simple_i.cpp:
+ * EventServices/OMG_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp:
+ * InterfaceRepo/IFRBrowser.cpp:
+ * LocalObjects/Messenger/Messenger_i.cpp:
+ * LocalObjects/ServantLocator/MessengerLocator_i.cpp:
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Messaging/AMIcallback/MessengerServer.cpp:
+ * Messaging/RelativeRoundtripTimeout/Messenger_i.cpp:
+ * Multithreading/GracefulShutdown/MessengerServer.h:
+ * NamingService/Naming_Server/MessengerTask.cpp:
+ * NamingService/Naming_Server/NamingTask.cpp:
+ * NotifyService/EventSequence/EventSequenceConsumer_i.cpp:
+ * NotifyService/EventSequence/MessengerConsumer.cpp:
+ * NotifyService/EventSequence/Messenger_i.cpp:
+ * NotifyService/Filtering/MessengerConsumer.cpp:
+ * NotifyService/Filtering/Messenger_i.cpp:
+ * NotifyService/Filtering/StructuredEventConsumer_i.cpp:
+ * NotifyService/Messenger/MessengerConsumer.cpp:
+ * NotifyService/Messenger/Messenger_i.cpp:
+ * NotifyService/Messenger/StructuredEventConsumer_i.cpp:
+ * NotifyService/OfferSubscriptions/MessengerConsumer.cpp:
+ * NotifyService/OfferSubscriptions/Messenger_i.cpp:
+ * NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp:
+ * NotifyService/QoSProperties/MessengerConsumer.cpp:
+ * NotifyService/QoSProperties/MessengerServer.cpp:
+ * NotifyService/QoSProperties/Messenger_i.cpp:
+ * NotifyService/QoSProperties/StructuredEventConsumer_i.cpp:
+ * NotifyService/SupplierSideNC/MessengerConsumer.cpp:
+ * NotifyService/SupplierSideNC/Messenger_i.cpp:
+ * NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp:
+ * PortableInterceptors/Auth/ClientInitializer.cpp:
+ * PortableInterceptors/Auth/ClientInterceptor.cpp:
+ * PortableInterceptors/Auth/Messenger_i.cpp:
+ * PortableInterceptors/Auth/ServerInitializer.cpp:
+ * PortableInterceptors/Auth/ServerInterceptor.cpp:
+ * PortableInterceptors/IOR/ClientInitializer.cpp:
+ * PortableInterceptors/IOR/ClientInterceptor.cpp:
+ * PortableInterceptors/IOR/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/ServerInterceptor.cpp:
+ * SmartProxies/Logger_i.cpp:
+ * SmartProxies/Smart_Messenger_Proxy.cpp:
+ Added missing std:: prefix on the iostreams.
+
+Tue Jan 11 10:05:36 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * AMH/*:
+
+ Added new example directory for code related to new AMH chapter
+ of TAO 1.4a book.
+
+Mon Jan 10 07:51:16 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Put back the registration with the reactor which was accidentally
+ removed.
+
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+
+ Increased the timeout for the first supplier.
+
+Mon Jan 10 07:14:37 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * BiDirectionalGIOP/BiDirectionalGIOP.mpc:
+ * BiDirectionalGIOP/README:
+ * BiDirectionalGIOP/bidir_giop_pch.h:
+ * BiDirectionalGIOP/callback.idl:
+ * BiDirectionalGIOP/callback_i.h:
+ * BiDirectionalGIOP/callback_i.cpp:
+ * BiDirectionalGIOP/client.cpp:
+ * BiDirectionalGIOP/run_test.pl:
+ * BiDirectionalGIOP/server.cpp:
+ * BiDirectionalGIOP/simple.idl:
+ * BiDirectionalGIOP/simple_i.h:
+ * BiDirectionalGIOP/simple_i.cpp:
+ * DevGuideExamples.mwc:
+ * EventServices/OMG_Basic/.cvsignore:
+ * EventServices/OMG_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_Basic/EchoEventConsumer_i.h:
+ * EventServices/OMG_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/OMG_Basic/ExceptionUtil.h:
+ * EventServices/OMG_Basic/OMG_Basic.mpc:
+ * EventServices/OMG_Basic/README:
+ * EventServices/OMG_Basic/run_test.pl:
+ * EventServices/OMG_SupplierSideEC/.cvsignore:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h:
+ * EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp:
+ * EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp:
+ * EventServices/OMG_SupplierSideEC/ExceptionUtil.h:
+ * EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc:
+ * EventServices/OMG_SupplierSideEC/README:
+ * EventServices/OMG_SupplierSideEC/run_test.pl:
+ * EventServices/RTEC_Basic/.cvsignore:
+ * EventServices/RTEC_Basic/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Basic/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Basic/EchoEventSupplier_i.h:
+ * EventServices/RTEC_Basic/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_Basic/ExceptionUtil.h:
+ * EventServices/RTEC_Basic/README:
+ * EventServices/RTEC_Basic/RTEC_Basic.mpc:
+ * EventServices/RTEC_Basic/run_test.pl:
+ * EventServices/RTEC_Federated/.cvsignore:
+ * EventServices/RTEC_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Federated/EchoEventSupplier_i.h:
+ * EventServices/RTEC_Federated/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_Federated/ExceptionUtil.h:
+ * EventServices/RTEC_Federated/README:
+ * EventServices/RTEC_Federated/RTEC_Federated.mpc:
+ * EventServices/RTEC_Federated/run_test.pl:
+ * EventServices/RTEC_Federated/supplier.conf:
+ * EventServices/RTEC_Filter/.cvsignore:
+ * EventServices/RTEC_Filter/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.h:
+ * EventServices/RTEC_Filter/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_Filter/EchoEventSupplier_i.h:
+ * EventServices/RTEC_Filter/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_Filter/ExceptionUtil.h:
+ * EventServices/RTEC_Filter/README:
+ * EventServices/RTEC_Filter/RTEC_Filter.mpc:
+ * EventServices/RTEC_Filter/ec.conf:
+ * EventServices/RTEC_Filter/run_test.pl:
+ * EventServices/RTEC_MCast_Federated/.cvsignore:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h:
+ * EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.h:
+ * EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp:
+ * EventServices/RTEC_MCast_Federated/ExceptionUtil.h:
+ * EventServices/RTEC_MCast_Federated/README:
+ * EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.h:
+ * EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp:
+ * EventServices/RTEC_MCast_Federated/run_test.pl:
+ * EventServices/RTEC_MCast_Federated/supplier.conf:
+ * GettingStarted/GettingStarted.mpc:
+ * GettingStarted/Messenger.idl:
+ * GettingStarted/MessengerClient.cpp:
+ * GettingStarted/MessengerServer.cpp:
+ * GettingStarted/Messenger_i.h:
+ * GettingStarted/Messenger_i.cpp:
+ * GettingStarted/README:
+ * GettingStarted/run_test.pl:
+ * GettingStarted/started_pch.h:
+ * GettingStarted/started_pch.cpp:
+ * ImplRepo/ImplRepo.mpc:
+ * ImplRepo/Messenger.idl:
+ * ImplRepo/MessengerClient.cpp:
+ * ImplRepo/MessengerServer.cpp:
+ * ImplRepo/Messenger_i.h:
+ * ImplRepo/Messenger_i.cpp:
+ * ImplRepo/README:
+ * ImplRepo/run_test.pl:
+ * InterfaceRepo/IFRBrowser.cpp:
+ * InterfaceRepo/InterfaceRepo.mpc:
+ * InterfaceRepo/run_test.pl:
+ * InterfaceRepo/test.idl:
+ * LocalObjects/Messenger/Messenger.idl:
+ * LocalObjects/Messenger/Messenger.mpc:
+ * LocalObjects/Messenger/MessengerServer.cpp:
+ * LocalObjects/Messenger/Messenger_i.h:
+ * LocalObjects/Messenger/Messenger_i.cpp:
+ * LocalObjects/Messenger/run_test.pl:
+ * LocalObjects/ServantLocator/Messenger.idl:
+ * LocalObjects/ServantLocator/MessengerClient.cpp:
+ * LocalObjects/ServantLocator/MessengerLocator_i.h:
+ * LocalObjects/ServantLocator/MessengerLocator_i.cpp:
+ * LocalObjects/ServantLocator/MessengerServer.cpp:
+ * LocalObjects/ServantLocator/Messenger_i.h:
+ * LocalObjects/ServantLocator/Messenger_i.cpp:
+ * LocalObjects/ServantLocator/ServantLocator.mpc:
+ * LocalObjects/ServantLocator/run_test.pl:
+ * Messaging/AMIcallback/AMIcallback.mpc:
+ * Messaging/AMIcallback/Messenger.idl:
+ * Messaging/AMIcallback/MessengerClient.cpp:
+ * Messaging/AMIcallback/MessengerHandler.h:
+ * Messaging/AMIcallback/MessengerHandler.cpp:
+ * Messaging/AMIcallback/MessengerServer.cpp:
+ * Messaging/AMIcallback/Messenger_i.h:
+ * Messaging/AMIcallback/Messenger_i.cpp:
+ * Messaging/AMIcallback/README:
+ * Messaging/AMIcallback/run_test.pl:
+ * Messaging/RelativeRoundtripTimeout/Messenger.idl:
+ * Messaging/RelativeRoundtripTimeout/MessengerClient.cpp:
+ * Messaging/RelativeRoundtripTimeout/MessengerServer.cpp:
+ * Messaging/RelativeRoundtripTimeout/Messenger_i.h:
+ * Messaging/RelativeRoundtripTimeout/Messenger_i.cpp:
+ * Messaging/RelativeRoundtripTimeout/README:
+ * Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc:
+ * Messaging/RelativeRoundtripTimeout/run_test.pl:
+ * Multithreading/GracefulShutdown/GracefulShutdown.mpc:
+ * Multithreading/GracefulShutdown/Messenger.idl:
+ * Multithreading/GracefulShutdown/MessengerClient.cpp:
+ * Multithreading/GracefulShutdown/MessengerServer.h:
+ * Multithreading/GracefulShutdown/MessengerServer.cpp:
+ * Multithreading/GracefulShutdown/MessengerShutdownTimer.h:
+ * Multithreading/GracefulShutdown/MessengerShutdownTimer.cpp:
+ * Multithreading/GracefulShutdown/Messenger_i.h:
+ * Multithreading/GracefulShutdown/Messenger_i.cpp:
+ * Multithreading/GracefulShutdown/README:
+ * Multithreading/GracefulShutdown/run_test.pl:
+ * Multithreading/README:
+ * Multithreading/Reactive/Messenger.idl:
+ * Multithreading/Reactive/MessengerClient.cpp:
+ * Multithreading/Reactive/MessengerServer.cpp:
+ * Multithreading/Reactive/Messenger_i.h:
+ * Multithreading/Reactive/Messenger_i.cpp:
+ * Multithreading/Reactive/README:
+ * Multithreading/Reactive/Reactive.mpc:
+ * Multithreading/Reactive/run_test.pl:
+ * Multithreading/Reactive/svc.conf:
+ * Multithreading/ThreadPerConnection/Messenger.idl:
+ * Multithreading/ThreadPerConnection/MessengerClient.cpp:
+ * Multithreading/ThreadPerConnection/MessengerServer.cpp:
+ * Multithreading/ThreadPerConnection/Messenger_i.h:
+ * Multithreading/ThreadPerConnection/Messenger_i.cpp:
+ * Multithreading/ThreadPerConnection/README:
+ * Multithreading/ThreadPerConnection/ThreadPerConnection.mpc:
+ * Multithreading/ThreadPerConnection/run_test.pl:
+ * Multithreading/ThreadPerConnection/server.conf:
+ * Multithreading/ThreadPool/Messenger.idl:
+ * Multithreading/ThreadPool/MessengerClient.cpp:
+ * Multithreading/ThreadPool/MessengerServer.cpp:
+ * Multithreading/ThreadPool/Messenger_i.h:
+ * Multithreading/ThreadPool/Messenger_i.cpp:
+ * Multithreading/ThreadPool/README:
+ * Multithreading/ThreadPool/ThreadPool.mpc:
+ * Multithreading/ThreadPool/run_test.pl:
+ * NamingService/Messenger/Messenger.idl:
+ * NamingService/Messenger/Messenger.mpc:
+ * NamingService/Messenger/MessengerClient.cpp:
+ * NamingService/Messenger/MessengerServer.cpp:
+ * NamingService/Messenger/Messenger_i.h:
+ * NamingService/Messenger/Messenger_i.cpp:
+ * NamingService/Messenger/README:
+ * NamingService/Messenger/run_test.pl:
+ * NamingService/Naming_Client/.cvsignore:
+ * NamingService/Naming_Client/Messenger.idl:
+ * NamingService/Naming_Client/MessengerClient.cpp:
+ * NamingService/Naming_Client/MessengerServer.cpp:
+ * NamingService/Naming_Client/Messenger_i.h:
+ * NamingService/Naming_Client/Messenger_i.cpp:
+ * NamingService/Naming_Client/Naming_Client.mpc:
+ * NamingService/Naming_Client/README:
+ * NamingService/Naming_Client/run_test.pl:
+ * NamingService/Naming_Context_Ext/Messenger.idl:
+ * NamingService/Naming_Context_Ext/MessengerClient.cpp:
+ * NamingService/Naming_Context_Ext/MessengerServer.cpp:
+ * NamingService/Naming_Context_Ext/Messenger_i.h:
+ * NamingService/Naming_Context_Ext/Messenger_i.cpp:
+ * NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc:
+ * NamingService/Naming_Context_Ext/README:
+ * NamingService/Naming_Context_Ext/run_test.pl:
+ * NamingService/Naming_Server/Messenger.idl:
+ * NamingService/Naming_Server/MessengerTask.h:
+ * NamingService/Naming_Server/MessengerTask.cpp:
+ * NamingService/Naming_Server/Messenger_i.h:
+ * NamingService/Naming_Server/Messenger_i.cpp:
+ * NamingService/Naming_Server/NamingMessenger.cpp:
+ * NamingService/Naming_Server/NamingTask.h:
+ * NamingService/Naming_Server/NamingTask.cpp:
+ * NamingService/Naming_Server/Naming_Server.mpc:
+ * NamingService/Naming_Server/README:
+ * NamingService/Naming_Server/run_test.pl:
+ * NamingService/corbaloc_Messenger/Messenger.idl:
+ * NamingService/corbaloc_Messenger/MessengerClient.cpp:
+ * NamingService/corbaloc_Messenger/MessengerServer.cpp:
+ * NamingService/corbaloc_Messenger/Messenger_i.h:
+ * NamingService/corbaloc_Messenger/Messenger_i.cpp:
+ * NamingService/corbaloc_Messenger/README:
+ * NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc:
+ * NamingService/corbaloc_Messenger/run_test.pl:
+ * NamingService/corbaname_Messenger/Messenger.idl:
+ * NamingService/corbaname_Messenger/MessengerClient.cpp:
+ * NamingService/corbaname_Messenger/MessengerServer.cpp:
+ * NamingService/corbaname_Messenger/Messenger_i.h:
+ * NamingService/corbaname_Messenger/Messenger_i.cpp:
+ * NamingService/corbaname_Messenger/README:
+ * NamingService/corbaname_Messenger/corbaname_Messenger.mpc:
+ * NamingService/corbaname_Messenger/run_test.pl:
+ * NotifyService/EventSequence/EventSequence.mpc:
+ * NotifyService/EventSequence/EventSequenceConsumer_i.h:
+ * NotifyService/EventSequence/EventSequenceConsumer_i.cpp:
+ * NotifyService/EventSequence/EventSequenceSupplier_i.h:
+ * NotifyService/EventSequence/EventSequenceSupplier_i.cpp:
+ * NotifyService/EventSequence/Messenger.idl:
+ * NotifyService/EventSequence/MessengerClient.cpp:
+ * NotifyService/EventSequence/MessengerConsumer.cpp:
+ * NotifyService/EventSequence/MessengerServer.cpp:
+ * NotifyService/EventSequence/Messenger_i.h:
+ * NotifyService/EventSequence/Messenger_i.cpp:
+ * NotifyService/EventSequence/README:
+ * NotifyService/EventSequence/run_test.pl:
+ * NotifyService/Filtering/Filtering.mpc:
+ * NotifyService/Filtering/Messenger.idl:
+ * NotifyService/Filtering/MessengerClient.cpp:
+ * NotifyService/Filtering/MessengerConsumer.cpp:
+ * NotifyService/Filtering/MessengerServer.cpp:
+ * NotifyService/Filtering/Messenger_i.h:
+ * NotifyService/Filtering/Messenger_i.cpp:
+ * NotifyService/Filtering/README:
+ * NotifyService/Filtering/StructuredEventConsumer_i.h:
+ * NotifyService/Filtering/StructuredEventConsumer_i.cpp:
+ * NotifyService/Filtering/StructuredEventSupplier_i.h:
+ * NotifyService/Filtering/StructuredEventSupplier_i.cpp:
+ * NotifyService/Filtering/run_test.pl:
+ * NotifyService/Messenger/Messenger.idl:
+ * NotifyService/Messenger/Messenger.mpc:
+ * NotifyService/Messenger/MessengerClient.cpp:
+ * NotifyService/Messenger/MessengerConsumer.cpp:
+ * NotifyService/Messenger/MessengerServer.cpp:
+ * NotifyService/Messenger/Messenger_i.h:
+ * NotifyService/Messenger/Messenger_i.cpp:
+ * NotifyService/Messenger/README:
+ * NotifyService/Messenger/StructuredEventConsumer_i.h:
+ * NotifyService/Messenger/StructuredEventConsumer_i.cpp:
+ * NotifyService/Messenger/StructuredEventSupplier_i.h:
+ * NotifyService/Messenger/StructuredEventSupplier_i.cpp:
+ * NotifyService/Messenger/run_test.pl:
+ * NotifyService/OfferSubscriptions/Messenger.idl:
+ * NotifyService/OfferSubscriptions/MessengerClient.cpp:
+ * NotifyService/OfferSubscriptions/MessengerConsumer.cpp:
+ * NotifyService/OfferSubscriptions/MessengerServer.cpp:
+ * NotifyService/OfferSubscriptions/Messenger_i.h:
+ * NotifyService/OfferSubscriptions/Messenger_i.cpp:
+ * NotifyService/OfferSubscriptions/OfferSubscriptions.mpc:
+ * NotifyService/OfferSubscriptions/README:
+ * NotifyService/OfferSubscriptions/StructuredEventConsumer_i.h:
+ * NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp:
+ * NotifyService/OfferSubscriptions/StructuredEventSupplier_i.h:
+ * NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp:
+ * NotifyService/OfferSubscriptions/run_test.pl:
+ * NotifyService/QoSProperties/Messenger.idl:
+ * NotifyService/QoSProperties/MessengerClient.cpp:
+ * NotifyService/QoSProperties/MessengerConsumer.cpp:
+ * NotifyService/QoSProperties/MessengerServer.cpp:
+ * NotifyService/QoSProperties/Messenger_i.h:
+ * NotifyService/QoSProperties/Messenger_i.cpp:
+ * NotifyService/QoSProperties/QoSProperties.mpc:
+ * NotifyService/QoSProperties/README:
+ * NotifyService/QoSProperties/StructuredEventConsumer_i.h:
+ * NotifyService/QoSProperties/StructuredEventConsumer_i.cpp:
+ * NotifyService/QoSProperties/StructuredEventSupplier_i.h:
+ * NotifyService/QoSProperties/StructuredEventSupplier_i.cpp:
+ * NotifyService/QoSProperties/run_test.pl:
+ * NotifyService/SupplierSideNC/Messenger.idl:
+ * NotifyService/SupplierSideNC/MessengerClient.cpp:
+ * NotifyService/SupplierSideNC/MessengerConsumer.cpp:
+ * NotifyService/SupplierSideNC/MessengerServer.cpp:
+ * NotifyService/SupplierSideNC/MessengerSupplier.cpp:
+ * NotifyService/SupplierSideNC/Messenger_i.h:
+ * NotifyService/SupplierSideNC/Messenger_i.cpp:
+ * NotifyService/SupplierSideNC/README:
+ * NotifyService/SupplierSideNC/StructuredEventConsumer_i.h:
+ * NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp:
+ * NotifyService/SupplierSideNC/StructuredEventSupplier_i.h:
+ * NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp:
+ * NotifyService/SupplierSideNC/SupplierSideNC.mpc:
+ * NotifyService/SupplierSideNC/run_test.pl:
+ * PortableInterceptors/Auth/Auth.mpc:
+ * PortableInterceptors/Auth/ClientInitializer.h:
+ * PortableInterceptors/Auth/ClientInitializer.cpp:
+ * PortableInterceptors/Auth/ClientInterceptor.h:
+ * PortableInterceptors/Auth/ClientInterceptor.cpp:
+ * PortableInterceptors/Auth/Messenger.idl:
+ * PortableInterceptors/Auth/MessengerClient.cpp:
+ * PortableInterceptors/Auth/MessengerServer.cpp:
+ * PortableInterceptors/Auth/Messenger_i.h:
+ * PortableInterceptors/Auth/Messenger_i.cpp:
+ * PortableInterceptors/Auth/README:
+ * PortableInterceptors/Auth/ServerInitializer.h:
+ * PortableInterceptors/Auth/ServerInitializer.cpp:
+ * PortableInterceptors/Auth/ServerInterceptor.h:
+ * PortableInterceptors/Auth/ServerInterceptor.cpp:
+ * PortableInterceptors/Auth/run_test.pl:
+ * PortableInterceptors/IOR/ClientInitializer.h:
+ * PortableInterceptors/IOR/ClientInitializer.cpp:
+ * PortableInterceptors/IOR/ClientInterceptor.h:
+ * PortableInterceptors/IOR/ClientInterceptor.cpp:
+ * PortableInterceptors/IOR/IOR.mpc:
+ * PortableInterceptors/IOR/Messenger.idl:
+ * PortableInterceptors/IOR/MessengerClient.cpp:
+ * PortableInterceptors/IOR/MessengerServer.cpp:
+ * PortableInterceptors/IOR/Messenger_i.h:
+ * PortableInterceptors/IOR/Messenger_i.cpp:
+ * PortableInterceptors/IOR/README:
+ * PortableInterceptors/IOR/ServerIORInterceptor.h:
+ * PortableInterceptors/IOR/ServerIORInterceptor.cpp:
+ * PortableInterceptors/IOR/ServerInitializer.h:
+ * PortableInterceptors/IOR/ServerInitializer.cpp:
+ * PortableInterceptors/IOR/ServerInterceptor.h:
+ * PortableInterceptors/IOR/ServerInterceptor.cpp:
+ * PortableInterceptors/IOR/run_test.pl:
+ * PortableInterceptors/PICurrent/ClientInitializer.h:
+ * PortableInterceptors/PICurrent/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent/Messenger.idl:
+ * PortableInterceptors/PICurrent/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent/Messenger_i.h:
+ * PortableInterceptors/PICurrent/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent/PICurrent.mpc:
+ * PortableInterceptors/PICurrent/README:
+ * PortableInterceptors/PICurrent/ServerInitializer.h:
+ * PortableInterceptors/PICurrent/ServerInitializer.cpp:
+ * PortableInterceptors/PICurrent/ServerInterceptor.h:
+ * PortableInterceptors/PICurrent/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent/run_test.pl:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.h:
+ * PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/Messenger.idl:
+ * PortableInterceptors/PICurrent_NameService/MessengerClient.cpp:
+ * PortableInterceptors/PICurrent_NameService/MessengerServer.cpp:
+ * PortableInterceptors/PICurrent_NameService/Messenger_i.h:
+ * PortableInterceptors/PICurrent_NameService/Messenger_i.cpp:
+ * PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc:
+ * PortableInterceptors/PICurrent_NameService/README:
+ * PortableInterceptors/PICurrent_NameService/ServerInitializer.h:
+ * PortableInterceptors/PICurrent_NameService/ServerInitializer.cpp:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.h:
+ * PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp:
+ * PortableInterceptors/PICurrent_NameService/run_test.pl:
+ * PortableInterceptors/SimpleCodec/ClientInitializer.h:
+ * PortableInterceptors/SimpleCodec/ClientInitializer.cpp:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.h:
+ * PortableInterceptors/SimpleCodec/ClientInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/Messenger.idl:
+ * PortableInterceptors/SimpleCodec/MessengerClient.cpp:
+ * PortableInterceptors/SimpleCodec/MessengerServer.cpp:
+ * PortableInterceptors/SimpleCodec/Messenger_i.h:
+ * PortableInterceptors/SimpleCodec/Messenger_i.cpp:
+ * PortableInterceptors/SimpleCodec/README:
+ * PortableInterceptors/SimpleCodec/ServerInitializer.h:
+ * PortableInterceptors/SimpleCodec/ServerInitializer.cpp:
+ * PortableInterceptors/SimpleCodec/ServerInterceptor.h:
+ * PortableInterceptors/SimpleCodec/ServerInterceptor.cpp:
+ * PortableInterceptors/SimpleCodec/SimpleCode.mpc:
+ * PortableInterceptors/SimpleCodec/run_test.pl:
+ * RTCORBA/Messenger.idl:
+ * RTCORBA/MessengerClient.cpp:
+ * RTCORBA/MessengerServer.cpp:
+ * RTCORBA/Messenger_i.h:
+ * RTCORBA/Messenger_i.cpp:
+ * RTCORBA/README:
+ * RTCORBA/RTCORBA.mpc:
+ * RTCORBA/common.h:
+ * RTCORBA/common.cpp:
+ * RTCORBA/run_test.pl:
+ * RTCORBA/svc.conf:
+ * Security/ParticipatingApp/Messenger.idl:
+ * Security/ParticipatingApp/MessengerClient.cpp:
+ * Security/ParticipatingApp/MessengerServer.cpp:
+ * Security/ParticipatingApp/Messenger_i.h:
+ * Security/ParticipatingApp/Messenger_i.cpp:
+ * Security/ParticipatingApp/ParticipatingApp.mpc:
+ * Security/ParticipatingApp/README:
+ * Security/ParticipatingApp/cacert.pem:
+ * Security/ParticipatingApp/client.conf:
+ * Security/ParticipatingApp/clientcert.pem:
+ * Security/ParticipatingApp/clientkey.pem:
+ * Security/ParticipatingApp/run_test.pl:
+ * Security/ParticipatingApp/server.conf:
+ * Security/ParticipatingApp/servercert.pem:
+ * Security/ParticipatingApp/serverkey.pem:
+ * Security/PolicyControllingApp/Messenger.idl:
+ * Security/PolicyControllingApp/MessengerClient.cpp:
+ * Security/PolicyControllingApp/MessengerServer.cpp:
+ * Security/PolicyControllingApp/Messenger_i.h:
+ * Security/PolicyControllingApp/Messenger_i.cpp:
+ * Security/PolicyControllingApp/PolicyControllingApp.mpc:
+ * Security/PolicyControllingApp/README:
+ * Security/PolicyControllingApp/cacert.pem:
+ * Security/PolicyControllingApp/client.conf:
+ * Security/PolicyControllingApp/client1.conf:
+ * Security/PolicyControllingApp/clientcert.pem:
+ * Security/PolicyControllingApp/clientkey.pem:
+ * Security/PolicyControllingApp/run_test.pl:
+ * Security/PolicyControllingApp/server.conf:
+ * Security/PolicyControllingApp/server1.conf:
+ * Security/PolicyControllingApp/servercert.pem:
+ * Security/PolicyControllingApp/serverkey.pem:
+ * Security/SecurityUnawareApp/Messenger.idl:
+ * Security/SecurityUnawareApp/MessengerClient.cpp:
+ * Security/SecurityUnawareApp/MessengerI.cpp:
+ * Security/SecurityUnawareApp/MessengerServer.cpp:
+ * Security/SecurityUnawareApp/Messenger_i.h:
+ * Security/SecurityUnawareApp/Messenger_i.cpp:
+ * Security/SecurityUnawareApp/README:
+ * Security/SecurityUnawareApp/SecurityUnawareApp.mpc:
+ * Security/SecurityUnawareApp/cacert.pem:
+ * Security/SecurityUnawareApp/client.conf:
+ * Security/SecurityUnawareApp/client1.conf:
+ * Security/SecurityUnawareApp/clientcert.pem:
+ * Security/SecurityUnawareApp/clientkey.pem:
+ * Security/SecurityUnawareApp/run_test.pl:
+ * Security/SecurityUnawareApp/server.conf:
+ * Security/SecurityUnawareApp/servercert.pem:
+ * Security/SecurityUnawareApp/serverkey.pem:
+ * SmartProxies/Logger.idl:
+ * SmartProxies/LoggerServer.cpp:
+ * SmartProxies/Logger_i.h:
+ * SmartProxies/Logger_i.cpp:
+ * SmartProxies/Messenger.idl:
+ * SmartProxies/MessengerClient.cpp:
+ * SmartProxies/MessengerServer.cpp:
+ * SmartProxies/Messenger_i.h:
+ * SmartProxies/Messenger_i.cpp:
+ * SmartProxies/README:
+ * SmartProxies/SmartProxies.mpc:
+ * SmartProxies/Smart_Messenger_Proxy.h:
+ * SmartProxies/Smart_Messenger_Proxy.cpp:
+ * SmartProxies/run_test.pl:
+ * ValueTypes/Messenger/Message_i.h:
+ * ValueTypes/Messenger/Message_i.cpp:
+ * ValueTypes/Messenger/Messenger.idl:
+ * ValueTypes/Messenger/MessengerClient.cpp:
+ * ValueTypes/Messenger/MessengerServer.cpp:
+ * ValueTypes/Messenger/Messenger_i.h:
+ * ValueTypes/Messenger/Messenger_i.cpp:
+ * ValueTypes/Messenger/README:
+ * ValueTypes/Messenger/ValueTypes.mpc:
+ * ValueTypes/Messenger/_pch.h:
+ * ValueTypes/Messenger/_pch.cpp:
+ * ValueTypes/Messenger/run_test.pl:
+ * devguide_client.mpb:
+ * devguide_example.mpb:
+ * devguide_server.mpb:
+ * readme.txt:
+
+ Brought over the TAO 1.3a DevGuideExamples and updated them for
+ TAO 1.4a.
diff --git a/TAO/DevGuideExamples/DevGuideExamples.mwc b/TAO/DevGuideExamples/DevGuideExamples.mwc
new file mode 100644
index 00000000000..bbf27b8533c
--- /dev/null
+++ b/TAO/DevGuideExamples/DevGuideExamples.mwc
@@ -0,0 +1,3 @@
+workspace {
+ cmdline = -include $PWD
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..d7a67dbd214
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumerMain.cpp
@@ -0,0 +1,83 @@
+// EchoEventConsumerMain.cpp
+// Main program for a PushConsumer of Echo events.
+
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/CosEventCommC.h>
+#include <orbsvcs/CosEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+
+const int EVENTS_TILL_SHUTDOWN = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str("CosEventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ CosEventChannelAdmin::EventChannel_var echoEC =
+ CosEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(echoEC.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "Found the EchoEventChannel." << std::endl;
+
+ // Get a ConsumerAdmin object from the EventChannel.
+ CosEventChannelAdmin::ConsumerAdmin_var consumerAdmin =
+ echoEC->for_consumers();
+
+ // Get a ProxyPushSupplier from the ConsumerAdmin.
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumerAdmin->obtain_push_supplier();
+
+ // Instantiate an EchoEventConsumer_i servant.
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENTS_TILL_SHUTDOWN);
+
+ // Register it with the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ CosEventComm::PushConsumer_var consumer =
+ CosEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect to the ProxyPushSupplier, passing our PushConsumer object
+ // reference to it.
+ supplier->connect_push_consumer(consumer.in());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ orb->destroy();
+
+ std::cout << "Test complete." << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Consumer: Caught CORBA::Exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..cf1468ca9fa
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.cpp
@@ -0,0 +1,42 @@
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(CosEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+}
+
+// Override the push() operation.
+void EchoEventConsumer_i::push(const CORBA::Any & data)
+{
+ // Extract event data from the any.
+ const char* eventData;
+ if (data >>= eventData)
+ {
+ std::cout << "EchoEventConsumer_i::push(): Received event: "
+ << eventData << std::endl;
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Override the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..483c17de403
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventConsumer_i.h
@@ -0,0 +1,29 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/CosEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/CosEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_CosEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const CORBA::Any & data);
+
+ virtual void disconnect_push_consumer();
+
+ private:
+ CORBA::ORB_var orb_;
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..713b8490c13
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/EchoEventSupplierMain.cpp
@@ -0,0 +1,70 @@
+// Main program for a PushSupplier of Echo events.
+
+#include <orbsvcs/CosEventCommC.h>
+#include <orbsvcs/CosEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EventChannel.
+ obj = root_context->resolve_str("CosEventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ CosEventChannelAdmin::EventChannel_var echoEC =
+ CosEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(echoEC.in())) {
+ std::cerr << "Could not resolve EchoEventChannel." << std::endl;
+ return 1;
+ }
+
+ // Get a SupplierAdmin object from the EventChannel.
+ CosEventChannelAdmin::SupplierAdmin_var supplierAdmin =
+ echoEC->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplierAdmin->obtain_push_consumer();
+
+ // Connect to the ProxyPushConsumer as a PushSupplier
+ // (passing a nil PushSupplier object reference to it because
+ // we don't care to be notified about disconnects).
+ consumer->connect_push_supplier(CosEventComm::PushSupplier::_nil());
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup("Hello, world.");
+
+ // Send one event per second. (approx)
+ while (1) {
+ // Insert the event data into an any.
+ CORBA::Any any;
+ any <<= eventData;
+
+ // Now push the event to the consumer
+ consumer->push(any);
+
+ ACE_Time_Value event_delay(0, 1000 * EVENT_DELAY_MS);
+ orb->run(event_delay);
+ }
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Supplier Caught CORBA::Exception. " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/OMG_Basic.mpc b/TAO/DevGuideExamples/EventServices/OMG_Basic/OMG_Basic.mpc
new file mode 100644
index 00000000000..c625d77490d
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/OMG_Basic.mpc
@@ -0,0 +1,18 @@
+project(*Supplier): namingexe, event_skel {
+ exename = EchoEventSupplier
+ includes += ../common
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ }
+}
+
+project(*Consumer): namingexe, event_skel {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/README b/TAO/DevGuideExamples/EventServices/OMG_Basic/README
new file mode 100644
index 00000000000..475f9c6e0a2
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/README
@@ -0,0 +1,62 @@
+OMG Event Service
+
+
+File: DevGuideExamples/EventServices/OMG_Basic/README
+
+
+This directory contains a simple example of using the CosEvent service.
+This example uses the push/push model:
+
+ EchoEventSupplier ----> CosEvent_Service ----> EchoEventConsumer
+
+This example also works fine with the CosEvent_Service server.
+
+-------------------------------------------------------------------------
+
+Note: To test this, you must first run the Naming Service and the
+CosEvent Service, e.g.:
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior &
+$TAO_ROOT/orbsvcs/CosEvent_Service/CosEvent_Service -ORBInitRef NameService=file://ns.ior&
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier -ORBInitRef NameService=file://ns.ior
+
+ It will publish an event to the event channel every second.
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ORBInitRef NameService=file://ns.ior
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the CosEventComm::PushConsumer interface.
+
+
+
+Execution via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl -ExeSubDir <Release>
+
+
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl b/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
new file mode 100644
index 00000000000..78ced481eb9
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
@@ -0,0 +1,61 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$esiorfile = PerlACE::LocalFile ("es.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+# start Naming Service
+
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Event Service
+$EventService = "$ENV{TAO_ROOT}/orbsvcs/CosEvent_Service/CosEvent_Service";
+$ES = new PerlACE::Process($EventService, "-o $esiorfile $arg_ns_ref");
+$ES->Spawn();
+if (PerlACE::waitforfile_timed ($esiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$esiorfile>\n";
+ $ES->Kill();
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# start EchoEventSupplier
+$S = new PerlACE::Process("EchoEventSupplier", $arg_ns_ref);
+$S->Spawn();
+
+# start EchoEventConsumer
+$C = new PerlACE::Process("EchoEventConsumer", $arg_ns_ref);
+$C->Spawn();
+
+$CRET = $C->WaitKill(60);
+$S->Kill();
+$NS->Kill();
+$ES->Kill();
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..f8c9316ea86
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumerMain.cpp
@@ -0,0 +1,81 @@
+// EchoEventConsumerMain.cpp
+// Main program for a PushConsumer of Echo events.
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/CosEventCommC.h>
+#include <orbsvcs/CosEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const int EVENT_LIMIT = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str("CosEventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ CosEventChannelAdmin::EventChannel_var echoEC =
+ CosEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(echoEC.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "Found the EchoEventChannel." << std::endl;
+
+ // Get a ConsumerAdmin object from the EventChannel.
+ CosEventChannelAdmin::ConsumerAdmin_var consumerAdmin =
+ echoEC->for_consumers();
+
+ // Get a ProxyPushSupplier from the ConsumerAdmin.
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumerAdmin->obtain_push_supplier();
+
+ // Instantiate an EchoEventConsumer_i servant.
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENT_LIMIT);
+
+ // Register it with the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ CosEventComm::PushConsumer_var consumer =
+ CosEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect to the ProxyPushSupplier, passing our PushConsumer object
+ // reference to it.
+ supplier->connect_push_consumer(consumer.in());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ orb->destroy();
+
+ std::cout << "Test completed." << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..cf1468ca9fa
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.cpp
@@ -0,0 +1,42 @@
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(CosEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+}
+
+// Override the push() operation.
+void EchoEventConsumer_i::push(const CORBA::Any & data)
+{
+ // Extract event data from the any.
+ const char* eventData;
+ if (data >>= eventData)
+ {
+ std::cout << "EchoEventConsumer_i::push(): Received event: "
+ << eventData << std::endl;
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Override the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..483c17de403
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventConsumer_i.h
@@ -0,0 +1,29 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/CosEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/CosEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_CosEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const CORBA::Any & data);
+
+ virtual void disconnect_push_consumer();
+
+ private:
+ CORBA::ORB_var orb_;
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..b35ac72fdf8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/EchoEventSupplierMain.cpp
@@ -0,0 +1,88 @@
+// Main program for a PushSupplier of Echo events.
+
+#include <orbsvcs/CosEventCommC.h>
+#include <orbsvcs/CosEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/CosEvent/CEC_EventChannel.h>
+#include <orbsvcs/CosEvent/CEC_Default_Factory.h>
+
+#include <iostream>
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the CEC Factory so we can customize the CEC
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Get the root POA
+ CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA");
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ -1);
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+ PortableServer::POAManager_var poa_manager = root_poa->the_POAManager ();
+ poa_manager->activate ();
+
+ // Create and activate the event channel servant
+ CosEventChannelAdmin::EventChannel_var echoEC;
+
+ TAO_CEC_EventChannel_Attributes attr(root_poa.in(), root_poa.in());
+ TAO_CEC_EventChannel* ec = new TAO_CEC_EventChannel(attr);
+ ec->activate();
+ PortableServer::ObjectId_var oid = root_poa->activate_object(ec);
+ CORBA::Object_var ec_obj = root_poa->id_to_reference(oid.in());
+ echoEC = CosEventChannelAdmin::EventChannel::_narrow(ec_obj.in());
+
+ // Bind the EventChannel.
+ CosNaming::Name_var name = root_context->to_name("CosEventService");
+ root_context->rebind(name.in(), echoEC.in());
+
+ // Get a SupplierAdmin object from the EventChannel.
+ CosEventChannelAdmin::SupplierAdmin_var supplierAdmin =
+ echoEC->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplierAdmin->obtain_push_consumer();
+
+ // Connect to the ProxyPushConsumer as a PushSupplier
+ // (passing a nil PushSupplier object reference to it because
+ // we don't care to be notified about disconnects).
+ consumer->connect_push_supplier(CosEventComm::PushSupplier::_nil());
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup("Hello, world.");
+
+ while (1) {
+ // Insert the event data into an any.
+ CORBA::Any any;
+ any <<= eventData;
+
+ // Now push the event to the consumer
+ consumer->push(any);
+
+ ACE_Time_Value tv(0, 1000 * EVENT_DELAY_MS);
+ orb->run(tv);
+ }
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught unknown CORBA::Exception exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc
new file mode 100644
index 00000000000..1caedc76b33
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/OMG_SupplierSideEC.mpc
@@ -0,0 +1,19 @@
+project(*Supplier): namingexe, event_serv {
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ }
+}
+
+project(*Consumer): namingexe, event_skel {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/README b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/README
new file mode 100644
index 00000000000..aea980a3a44
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/README
@@ -0,0 +1,61 @@
+OMG Event Service
+
+
+File: DevGuideExamples/EventServices/OMG_SupplierSideEC/README
+
+
+This directory contains an example that extends the previous examples
+so that the event supplier creates its own local event channel. All
+other code is identical to that in EventServices/OMG_Basic.
+
+ EchoEventSupplier (contains EC) ------> EchoEventConsumer
+
+By default, the supplier will create a "Native" EC. Passing -wrapper
+will force creation of a "Wrapper" EC that will utilize a Real-Time
+Event Channel (RTEC) as the underlying implementation.
+
+-------------------------------------------------------------------------
+
+Note: To test this, you must first run the Naming Service
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier -ORBInitRef NameService=file://ns.ior
+
+ It will create an event channel and publish an event to it every
+ second.
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ORBInitRef NameService=file://ns.ior
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the CosEventComm::PushConsumer interface.
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/run_test.pl b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/run_test.pl
new file mode 100644
index 00000000000..80e9b7846c7
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/run_test.pl
@@ -0,0 +1,48 @@
+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;
+
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$iorfile";
+
+unlink $iorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $iorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start EchoEventSupplier
+$S = new PerlACE::Process("EchoEventSupplier", $arg_ns_ref);
+$S->Spawn();
+
+# Allow time for the supplier to register with the Naming Service
+sleep(2);
+
+# start EchoEventConsumer
+$C = new PerlACE::Process("EchoEventConsumer", $arg_ns_ref);
+$CRET = $C->SpawnWaitKill(60);
+
+$S->Kill();
+$NS->Kill();
+
+unlink $iorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+
+exit 0;
+
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/ConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/ConsumerMain.cpp
new file mode 100644
index 00000000000..5fedaa7c3f5
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/ConsumerMain.cpp
@@ -0,0 +1,103 @@
+// ConsumerMain.cpp
+// Main program for a TypedPushConsumer of Messenger objects.
+
+
+#include "Messenger_i.h"
+#include "Consumer_i.h"
+
+#include <orbsvcs/CosTypedEventCommC.h>
+#include <orbsvcs/CosTypedEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+#include <tao/AnyTypeCode/TypeCode.h>
+#include <ace/OS_NS_stdio.h>
+#include <iostream>
+
+const int EVENTS_TILL_SHUTDOWN = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EventChannel.
+ obj = root_context->resolve_str("CosEventService");
+
+ // Downcast the object reference to an TypedEventChannel reference.
+ CosTypedEventChannelAdmin::TypedEventChannel_var ec =
+ CosTypedEventChannelAdmin::TypedEventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not narrow TypedEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "Found the TypedEventChannel." << std::endl;
+
+ // Get a ConsumerAdmin object from the EventChannel.
+ CosTypedEventChannelAdmin::TypedConsumerAdmin_var consumerAdmin =
+ ec->for_consumers();
+
+ // Get a ProxyPushSupplier from the ConsumerAdmin.
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumerAdmin->obtain_typed_push_supplier(::_tc_Messenger->id());
+
+ // Instantiate an Messenger_i servant.
+ Messenger_i servant(orb.in(), supplier.in(), EVENTS_TILL_SHUTDOWN);
+
+ // Register it with the RootPOA.
+ // Activate the POA here before we connect our consumer.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var messenger_obj = poa->id_to_reference(oid.in());
+ Consumer_i consumer_servant(orb.in(), messenger_obj.in());
+ PortableServer::ObjectId_var cons_oid =
+ poa->activate_object(&consumer_servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(cons_oid.in());
+ CosTypedEventComm::TypedPushConsumer_var consumer =
+ CosTypedEventComm::TypedPushConsumer::_narrow(consumer_obj.in());
+
+ // Connect to the ProxyPushSupplier, passing our PushConsumer object
+ // reference to it.
+ supplier->connect_push_consumer(consumer.in());
+
+ std::cout << "Ready to receive events..." << std::endl;
+
+ CORBA::String_var str = orb->object_to_string (consumer.in ());
+ const char* ior_file_name = "Consumer.ior";
+ FILE *output_file= ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(ior_file_name),
+ ACE_LIB_TEXT("w"));
+ if (output_file == 0) {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name),
+ 1);
+ }
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ // Disconnect the ProxyPushSupplier.
+ orb->destroy();
+
+ std::cout << "Test complete." << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA::Exception. " << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp
new file mode 100644
index 00000000000..57b72a2ee21
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp
@@ -0,0 +1,39 @@
+// Implements a PushConsumer.
+
+#include "Consumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+Consumer_i::Consumer_i(CORBA::ORB_ptr orb,
+ CORBA::Object_ptr obj)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , object_(CORBA::Object::_duplicate(obj))
+{
+}
+
+
+CORBA::Object_ptr
+Consumer_i::get_typed_consumer ()
+ throw (CORBA::SystemException)
+{
+ return CORBA::Object::_duplicate(object_.in());
+}
+
+// Override the push() operation.
+void Consumer_i::push(const CORBA::Any &)
+ throw(CORBA::SystemException)
+{
+ throw CORBA::NO_IMPLEMENT ();
+}
+
+// Override the disconnect_push_consumer() operation.
+void Consumer_i::disconnect_push_consumer()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.h b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.h
new file mode 100644
index 00000000000..d4d4388eaab
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.h
@@ -0,0 +1,32 @@
+// Consumer_i.h
+// Implements a TypedPushConsumer.
+
+#ifndef _Consumer_i_h_
+#define _Consumer_i_h_
+
+#include <orbsvcs/CosTypedEventCommS.h> // for POA_CosTypedEventComm::TypedPushConsumer
+
+class Consumer_i
+: public virtual POA_CosTypedEventComm::TypedPushConsumer
+{
+ public:
+ // Constructor
+ Consumer_i(CORBA::ORB_ptr orb,
+ CORBA::Object_ptr obj);
+
+ // Override operations from TypedPushConsumer interface.
+ virtual CORBA::Object_ptr get_typed_consumer ()
+ throw (CORBA::SystemException);
+
+ virtual void push(const CORBA::Any & data)
+ throw(CORBA::SystemException);
+
+ virtual void disconnect_push_consumer()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ CORBA::Object_var object_;
+};
+
+#endif // _Consumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger.idl b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger.idl
new file mode 100644
index 00000000000..6f6cdf2f33c
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger.idl
@@ -0,0 +1,10 @@
+// Messenger.idl
+
+interface Messenger
+{
+ // Modified to make message an in parameter and
+ // remove the return value.
+ void send_message(in string user_name,
+ in string subject,
+ in string message);
+};
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.cpp b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.cpp
new file mode 100644
index 00000000000..5d91988b9a1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.cpp
@@ -0,0 +1,40 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(CosEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+void Messenger_i::send_message (const char * user_name,
+ const char * subject,
+ const char * message)
+ throw (CORBA::SystemException)
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.h b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.h
new file mode 100644
index 00000000000..1b71a298e0a
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/Messenger_i.h
@@ -0,0 +1,46 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <orbsvcs/CosTypedEventChannelAdminC.h>
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (CORBA::ORB_ptr orb,
+ CosEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual void send_message (const char * user_name,
+ const char * subject,
+ const char * message)
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/OMG_TypedEC.mpc b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/OMG_TypedEC.mpc
new file mode 100644
index 00000000000..27c9419cc04
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/OMG_TypedEC.mpc
@@ -0,0 +1,19 @@
+project(*Supplier): namingexe, event_skel {
+ exename = Supplier
+ includes += ../common
+ Source_Files {
+ SupplierMain.cpp
+ MessengerC.cpp
+ }
+}
+
+project(*Consumer): namingexe, event_skel {
+ exename = Consumer
+ includes += ../common
+
+ Source_Files {
+ ConsumerMain.cpp
+ Consumer_i.cpp
+ Messenger_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/README b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/README
new file mode 100644
index 00000000000..bae2c8463e8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/README
@@ -0,0 +1,17 @@
+
+$TAO_ROOT/DevGuideExamples/EventServices/OMG_TypedEC
+
+This example is a simple demonstration of Typed Event Channel usage.
+The Messenger interface is slightly modified for use in this example
+to allow suppliers to send messages to all connected consumers. To
+run the example, execute the following commands:
+
+export InterfaceRepositoryIOR=file://ifr.ior
+export NameServiceIOR=file://ns.ior
+$TAO_ROOT/orbsvcs/IFR_Service/IFR_Service -o ifr.ior &
+$ACE_ROOT/bin/tao_ifr Messenger.idl
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior &
+$TAO_ROOT/orbsvcs/CosEvent_Service/CosEvent_Service -t &
+./Consumer &
+./Supplier
+
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/SupplierMain.cpp b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/SupplierMain.cpp
new file mode 100644
index 00000000000..4d0567aefc1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/SupplierMain.cpp
@@ -0,0 +1,74 @@
+// Main program for a TypedPushSupplier of Messenger objects.
+
+#include <orbsvcs/CosTypedEventCommC.h>
+#include <orbsvcs/CosTypedEventChannelAdminC.h>
+#include <orbsvcs/CosNamingC.h>
+#include <tao/AnyTypeCode/TypeCode.h>
+
+#include <iostream>
+#include "MessengerC.h"
+
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EventChannel.
+ obj = root_context->resolve_str("CosEventService");
+
+ // Downcast the object reference to a TypedEventChannel reference.
+ CosTypedEventChannelAdmin::TypedEventChannel_var ec =
+ CosTypedEventChannelAdmin::TypedEventChannel::_narrow(obj.in ());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not resolve TypedEventChannel." << std::endl;
+ return 1;
+ }
+
+ // Get a SupplierAdmin object from the EventChannel.
+ CosTypedEventChannelAdmin::TypedSupplierAdmin_var supplierAdmin =
+ ec->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer_var consumer =
+ supplierAdmin->obtain_typed_push_consumer(::_tc_Messenger->id());
+
+ // Connect to the ProxyPushConsumer as a PushSupplier
+ // (passing a nil PushSupplier object reference to it because
+ // we don't care to be notified about disconnects).
+ consumer->connect_push_supplier(CosEventComm::PushSupplier::_nil());
+
+ // Obtain the interface from the event channel
+ CORBA::Object_var messenger_obj = consumer->get_typed_consumer();
+
+ // Narrow the interface
+ Messenger_var messenger = Messenger::_narrow(messenger_obj.in () );
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup("Hello, world.");
+
+ // Send one event per second. (approx)
+ while (1) {
+ messenger->send_message("King Lizard",
+ "Proclamations",
+ eventData.in());
+
+ ACE_Time_Value event_delay(0, 1000 * EVENT_DELAY_MS);
+ orb->run(event_delay);
+ }
+
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA::Exception. " << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/OMG_TypedEC/run_test.pl b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/run_test.pl
new file mode 100644
index 00000000000..11adc6d33e6
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_TypedEC/run_test.pl
@@ -0,0 +1,94 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$ifriorfile = PerlACE::LocalFile ("ifr.ior");
+$esiorfile = PerlACE::LocalFile ("es.ior");
+$consiorfile = PerlACE::LocalFile ("Consumer.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+$arg_ifr_ref = "-ORBInitRef InterfaceRepository=file://$ifriorfile";
+
+unlink $nsiorfile;
+unlink $ifriorfile;
+unlink $esiorfile;
+unlink $consiorfile;
+
+# start the Interface Repository Service
+$IFRService = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/IFR_Service";
+$IF = new PerlACE::Process ($IFRService, "-o $ifriorfile");
+$IF->Spawn ();
+if (PerlACE::waitforfile_timed ($ifriorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifriorfile>\n";
+ $IF->Kill ();
+ exit 1;
+}
+
+# load the IFR with the Messenger interface info
+$TAO_IFR = "$ENV{ACE_ROOT}/bin/tao_ifr";
+$TI = new PerlACE::Process ($TAO_IFR,
+ "$arg_ifr_ref Messenger.idl");
+$TI->SpawnWaitKill (60);
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ $IF->Kill ();
+ exit 1;
+}
+
+# start Event Service
+$EventService = "$ENV{TAO_ROOT}/orbsvcs/CosEvent_Service/CosEvent_Service";
+$ES = new PerlACE::Process($EventService,
+ "-t -o $esiorfile $arg_ns_ref $arg_ifr_ref");
+$ES->Spawn();
+if (PerlACE::waitforfile_timed ($esiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$esiorfile>\n";
+ $ES->Kill();
+ $NS->Kill ();
+ $IF->Kill ();
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# start Consumer
+$C = new PerlACE::Process("Consumer", "$arg_ns_ref");
+$C->Spawn();
+if (PerlACE::waitforfile_timed ($consiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$consiorfile>\n";
+ $ES->Kill();
+ $NS->Kill ();
+ $IF->Kill ();
+ $C->Kill ();
+ exit 1;
+}
+
+# start Supplier
+$S = new PerlACE::Process("Supplier", "$arg_ns_ref");
+$S->Spawn();
+
+$CRET = $C->WaitKill(60);
+$S->Kill();
+$NS->Kill();
+$ES->Kill();
+$IF->Kill();
+
+unlink $nsiorfile;
+unlink $ifriorfile;
+unlink $esiorfile;
+unlink $consiorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..ba0a01976d4
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumerMain.cpp
@@ -0,0 +1,88 @@
+// Main program for a PushConsumer of Echo events.
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const int EVENT_LIMIT = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str("EventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "EchoEventConsumerMain.cpp: Found the EchoEventChannel." << std::endl;
+
+ // Obtain a reference to the consumer administration object.
+ RtecEventChannelAdmin::ConsumerAdmin_var admin = ec->for_consumers();
+
+ // Obtain a reference to the push supplier proxy.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ admin->obtain_push_supplier();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventConsumer_i servant.
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENT_LIMIT);
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect as a consumer.
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (1);
+ qos.insert_type (ACE_ES_EVENT_ANY, // Event Type
+ 0); // handle to the rt_info
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "EchoEventConsumerMain.cpp: Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ // Disconnect the ProxyPushSupplier.
+ orb->destroy();
+
+ std::cout << "Test completed." << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..08bb270168b
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.cpp
@@ -0,0 +1,56 @@
+// EchoEventConsumer_i.cpp
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <ace/OS_NS_stdio.h>
+#include <sstream>
+
+// Constructor duplicates the ORB reference.
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+ // Nothing to do.
+}
+
+// Implement the push() operation.
+void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException)
+{
+ // Loop through the events, looking for shutdown events.
+ for (u_int i = 0; i < events.length (); ++i) {
+ //ACE_OS::printf(".");
+ // Extract event data from the any.
+ const char* eventData;
+ std::ostringstream out;
+ out << "Received event,"
+ << " type: " << events[i].header.type
+ << " source: " << events[i].header.source;
+ if (events[i].data.any_value >>= eventData) {
+ out << " text: " << eventData;
+ }
+
+ ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Implement the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..c59aa7944a8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventConsumer_i.h
@@ -0,0 +1,31 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/RtecEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_RtecEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException);
+
+ virtual void disconnect_push_consumer()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..57101632a30
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplierMain.cpp
@@ -0,0 +1,107 @@
+// EchoEventSupplierMain.cpp
+// Main program for a PushSupplier of Echo events.
+
+#include "EchoEventSupplier_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Get the Event Channel using Naming Services
+ obj = root_context->resolve_str("EventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not resolve EchoEventChannel." << std::endl;
+ return 1;
+ }
+
+ // Get a SupplierAdmin object from the EventChannel.
+ RtecEventChannelAdmin::SupplierAdmin_var admin = ec->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ admin->obtain_push_consumer();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventSupplier_i servant.
+ EchoEventSupplier_i servant(orb.in());
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushSupplier_var supplier =
+ RtecEventComm::PushSupplier::_narrow(supplier_obj.in());
+
+ // Publish the events the supplier provides.
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (MY_SOURCE_ID, // Supplier's unique id
+ MY_EVENT_TYPE, // Event type
+ 0, // handle to the rt_info structure
+ 1); // number of calls
+
+ // Connect as a supplier of the published events.
+ consumer->connect_push_supplier (supplier.in (),
+ qos.get_SupplierQOS ());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup("Hello, world.");
+
+ // Create an event set for one event
+ RtecEventComm::EventSet events (1);
+ events.length (1);
+
+ // Initialize event header.
+ events[0].header.source = MY_SOURCE_ID;
+ events[0].header.type = MY_EVENT_TYPE;
+
+ // Initialize data fields in event.
+ events[0].data.any_value <<= eventData;
+
+ std::cout << "Supplier starting sending of events" << std::endl;
+
+ while (1) {
+ consumer->push (events);
+ ACE_Time_Value tv(0, 1000 * EVENT_DELAY_MS);
+ orb->run(tv);
+ }
+
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Supplier::main() Caught CORBA::Exception" << std::endl << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.cpp
new file mode 100644
index 00000000000..c2339c37ad1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.cpp
@@ -0,0 +1,24 @@
+// EchoEventSupplier_i.cpp
+// Implements a PushSupplier.
+
+#include "EchoEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+// Constructor duplicates the ORB reference.
+EchoEventSupplier_i::EchoEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+ // Nothing to do.
+}
+
+// Override the disconnect_push_Supplier() operation.
+void EchoEventSupplier_i::disconnect_push_supplier()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.h
new file mode 100644
index 00000000000..b06f44cf8e3
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/EchoEventSupplier_i.h
@@ -0,0 +1,22 @@
+// EchoEventSupplier_i.h
+// Implements a PushSupplier.
+
+#ifndef _EchoEventSupplier_i_h_
+#define _EchoEventSupplier_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushSupplier
+
+class EchoEventSupplier_i : public virtual POA_RtecEventComm::PushSupplier
+{
+ public:
+ // Constructor
+ EchoEventSupplier_i(CORBA::ORB_ptr orb);
+
+ virtual void disconnect_push_supplier()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+};
+
+#endif // _EchoEventSupplier_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/README b/TAO/DevGuideExamples/EventServices/RTEC_Basic/README
new file mode 100644
index 00000000000..5c4e89eacc8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/README
@@ -0,0 +1,57 @@
+Real-Time Event Service
+
+
+File: DevGuideExamples/EventServices/RTEC_Basic/README
+
+
+This directory contains a simple example of using the RT Event service.
+This example uses the push/push model:
+
+ EchoEventSupplier ------> Event_Service ------> EchoEventConsumer
+
+-------------------------------------------------------------------------
+
+Note: To test this, you must first run the Naming Service and the
+Event Service, e.g.:
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+$TAO_ROOT/orbsvcs/Event_Service/Event_Service -ORBInitRef NameService=file://ns.ior&
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier -ORBInitRef NameService=file://ns.ior
+
+ It will publish an event to the event channel every 1 second.
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ORBInitRef NameService=file://ns.ior
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the RtecEventComm::PushConsumer interface.
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/RTEC_Basic.mpc b/TAO/DevGuideExamples/EventServices/RTEC_Basic/RTEC_Basic.mpc
new file mode 100644
index 00000000000..a67c5f1c819
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/RTEC_Basic.mpc
@@ -0,0 +1,20 @@
+project(*Supplier): namingexe, rteventexe, {
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ EchoEventSupplier_i.cpp
+ }
+}
+
+project(*Consumer): namingexe, rteventexe, {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Basic/run_test.pl b/TAO/DevGuideExamples/EventServices/RTEC_Basic/run_test.pl
new file mode 100644
index 00000000000..3fcc37a237c
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Basic/run_test.pl
@@ -0,0 +1,60 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$esiorfile = PerlACE::LocalFile ("es.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Event Service
+$EventService = "$ENV{TAO_ROOT}/orbsvcs/Event_Service/Event_Service";
+$ES = new PerlACE::Process($EventService, "-o $esiorfile $arg_ns_ref");
+$ES->Spawn();
+if (PerlACE::waitforfile_timed ($esiorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$esiorfile>\n";
+ $ES->Kill();
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# start EchoEventSupplier
+$S = new PerlACE::Process("EchoEventSupplier", $arg_ns_ref);
+$S->Spawn();
+
+# start EchoEventConsumer
+$C = new PerlACE::Process("EchoEventConsumer", $arg_ns_ref);
+$CRET = $C->SpawnWaitKill(60);
+
+$S->Kill();
+$NS->Kill();
+$ES->Kill();
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+
+exit 0;
+
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..d6b08f99a87
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumerMain.cpp
@@ -0,0 +1,103 @@
+// EchoEventConsumerMain.cpp
+// Main program for a PushConsumer of Echo events.
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+const int EVENT_LIMIT = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ const char* ecname = "EventService";
+ for (int i = 0; argv[i] != 0; i++) {
+ if (strcmp(argv[i], "-ecname") == 0) {
+ if (argv[i+1] != 0) {
+ ecname = argv[i+1];
+ } else {
+ std::cerr << "Missing Event channel name" << std::endl;
+ }
+ }
+ }
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context
+ = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str(ecname);
+
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "EchoEventConsumerMain.cpp: Found the EchoEventChannel." << std::endl;
+
+ // Obtain a reference to the consumer administration object.
+ RtecEventChannelAdmin::ConsumerAdmin_var admin = ec->for_consumers();
+
+ // Obtain a reference to the push supplier proxy.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ admin->obtain_push_supplier();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventConsumer_i servant and register it
+ // with the RootPOA
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENT_LIMIT);
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect as a consumer.
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert (MY_SOURCE_ID, // Source ID
+ MY_EVENT_TYPE, // Event Type
+ 0); // handle to the rt_info
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "EchoEventConsumerMain.cpp: Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ // Disconnect the ProxyPushSupplier.
+ orb->destroy();
+
+ std::cout << "Test completed." << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..08bb270168b
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.cpp
@@ -0,0 +1,56 @@
+// EchoEventConsumer_i.cpp
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <ace/OS_NS_stdio.h>
+#include <sstream>
+
+// Constructor duplicates the ORB reference.
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+ // Nothing to do.
+}
+
+// Implement the push() operation.
+void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException)
+{
+ // Loop through the events, looking for shutdown events.
+ for (u_int i = 0; i < events.length (); ++i) {
+ //ACE_OS::printf(".");
+ // Extract event data from the any.
+ const char* eventData;
+ std::ostringstream out;
+ out << "Received event,"
+ << " type: " << events[i].header.type
+ << " source: " << events[i].header.source;
+ if (events[i].data.any_value >>= eventData) {
+ out << " text: " << eventData;
+ }
+
+ ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Implement the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..c59aa7944a8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventConsumer_i.h
@@ -0,0 +1,31 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/RtecEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_RtecEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException);
+
+ virtual void disconnect_push_consumer()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..5ecf0c4c43f
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
@@ -0,0 +1,204 @@
+// EchoEventSupplierMain.cpp
+// Main program for a PushSupplier of Echo events.
+
+#include "EchoEventSupplier_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/Event/EC_Event_Channel.h>
+#include <orbsvcs/Event/EC_Gateway_IIOP.h>
+#include <orbsvcs/Event/EC_Default_Factory.h>
+
+#include <ace/Thread_Manager.h>
+#include <iostream>
+#include <fstream>
+
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+const int EVENT_DELAY_MS = 10;
+
+ACE_THR_FUNC_RETURN orb_thread(void *orb_ptr)
+{
+ CORBA::ORB_var orb = CORBA::ORB::_duplicate((CORBA::ORB_ptr) orb_ptr);
+ orb->run();
+ return 0;
+}
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the EC Factory so we can customize the EC
+ TAO_EC_Default_Factory::init_svcs ();
+
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ const char* ecname = "EventService";
+ const char* remote_ecname = 0;
+ const char* iorfile = 0;
+ for (int i = 0; argv[i] != 0; i++) {
+ if (strcmp(argv[i], "-ecname") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ ecname = argv[i];
+ } else {
+ std::cerr << "Missing Event channel name" << std::endl;
+ }
+ }
+ if (strcmp(argv[i], "-gateway") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ remote_ecname = argv[i];
+ } else {
+ std::cerr << "Missing Event channel name" << std::endl;
+ }
+ }
+ if (strcmp(argv[i], "-iorfile") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ iorfile = argv[i];
+ }
+ }
+ }
+
+ // Get the POA
+ CORBA::Object_var object = orb->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (object.in ());
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager ();
+ poa_manager->activate ();
+
+ // Spawn a thread for the orb
+ ACE_Thread_Manager *thread_mgr = ACE_Thread_Manager::instance();
+ thread_mgr->spawn(orb_thread, orb.in());
+
+ // Create a local event channel and register it with the RootPOA.
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (), poa.in ());
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate ();
+ PortableServer::ObjectId_var oid = poa->activate_object(&ec_impl);
+ CORBA::Object_var ec_obj = poa->id_to_reference(oid.in());
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in());
+
+ // Find the Naming Service.
+ object = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(object.in());
+ CosNaming::Name_var name = root_context->to_name(ecname);
+ root_context->rebind(name.in(), ec.in());
+
+ // Get a SupplierAdmin object from the EventChannel.
+ RtecEventChannelAdmin::SupplierAdmin_var admin = ec->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ admin->obtain_push_consumer();
+
+ // Instantiate an EchoEventSupplier_i servant.
+ EchoEventSupplier_i servant(orb.in());
+
+ // Register it with the RootPOA.
+ oid = poa->activate_object(&servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushSupplier_var supplier =
+ RtecEventComm::PushSupplier::_narrow(supplier_obj.in());
+
+ // Publish the events the supplier provides.
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (MY_SOURCE_ID, // Supplier's unique id
+ MY_EVENT_TYPE, // Event type
+ 0, // handle to the rt_info structure
+ 1); // number of calls
+
+ // Connect as a supplier of the published events.
+ consumer->connect_push_supplier (supplier.in (),
+ qos.get_SupplierQOS ());
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup(ecname);
+
+ // Create an event set for one event
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ // Initialize event header.
+ event[0].header.source = MY_SOURCE_ID;
+ event[0].header.ttl = 1;
+ event[0].header.type = MY_EVENT_TYPE;
+ // Initialize data fields in event.
+ event[0].data.any_value <<= eventData;
+
+ TAO_EC_Gateway_IIOP gateway;
+ int gateway_initialized = 0;
+
+ std::cout << "Supplier starting sending of events.\n";
+
+ while (1) {
+
+ consumer->push (event);
+ ACE_Time_Value tv(0, 1000 * EVENT_DELAY_MS);
+ orb->run(tv);
+
+ if ((remote_ecname != 0) && (!gateway_initialized)) {
+
+ try {
+ // Get the remote event channel object
+ CORBA::Object_var obj = root_context->resolve_str(remote_ecname);
+ RtecEventChannelAdmin::EventChannel_var remote_ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+
+ int ok = 0;
+ if (!CORBA::is_nil(remote_ec.in())) {
+ // Now check if we can talk to it...
+ try {
+ RtecEventChannelAdmin::SupplierAdmin_var adm =
+ remote_ec->for_suppliers();
+ ok = 1;
+ } catch(const CORBA::UserException&) {
+ // What is the correct exception(s) to catch here?
+ }
+ }
+
+ // There is a good remote event channel so initialize the
+ // gateway.
+ if (ok) {
+ gateway.init(remote_ec.in(), ec.in());
+
+ PortableServer::ObjectId_var gateway_oid =
+ poa->activate_object(&gateway);
+ CORBA::Object_var gateway_obj =
+ poa->id_to_reference(gateway_oid.in());
+ RtecEventChannelAdmin::Observer_var obs =
+ RtecEventChannelAdmin::Observer::_narrow(gateway_obj.in());
+ RtecEventChannelAdmin::Observer_Handle local_ec_obs_handle =
+ ec->append_observer (obs.in ());
+ ACE_UNUSED_ARG (local_ec_obs_handle);
+ gateway_initialized = 1;
+ std::cout << "Gateway initialized\n";
+ if (iorfile != 0) {
+ CORBA::String_var str = orb->object_to_string( ec.in() );
+ std::ofstream iorFile( iorfile );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ }
+ }
+ } catch(const CosNaming::NamingContext::NotFound&) {
+ // Try again later...
+ }
+ }
+ }
+
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.cpp
new file mode 100644
index 00000000000..c2339c37ad1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.cpp
@@ -0,0 +1,24 @@
+// EchoEventSupplier_i.cpp
+// Implements a PushSupplier.
+
+#include "EchoEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+// Constructor duplicates the ORB reference.
+EchoEventSupplier_i::EchoEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+ // Nothing to do.
+}
+
+// Override the disconnect_push_Supplier() operation.
+void EchoEventSupplier_i::disconnect_push_supplier()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.h
new file mode 100644
index 00000000000..b06f44cf8e3
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplier_i.h
@@ -0,0 +1,22 @@
+// EchoEventSupplier_i.h
+// Implements a PushSupplier.
+
+#ifndef _EchoEventSupplier_i_h_
+#define _EchoEventSupplier_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushSupplier
+
+class EchoEventSupplier_i : public virtual POA_RtecEventComm::PushSupplier
+{
+ public:
+ // Constructor
+ EchoEventSupplier_i(CORBA::ORB_ptr orb);
+
+ virtual void disconnect_push_supplier()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+};
+
+#endif // _EchoEventSupplier_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/README b/TAO/DevGuideExamples/EventServices/RTEC_Federated/README
new file mode 100644
index 00000000000..c3c2e9b8576
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/README
@@ -0,0 +1,84 @@
+Real-Time Event Service
+
+
+File: DevGuideExamples/EventServices/RTEC_Federated/README
+
+
+This directory contains an example that shows how to create and
+federate real-time event channels.
+
+-------------------------------------------------------------------------
+
+Note: To test this, you must first run the Naming Service, e.g.:
+
+ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+After running the naming service, start a couple of suppliers:
+
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name1 -gateway name2
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name2 -gateway name1
+
+Now start some consumers:
+
+ ./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name1
+ ./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name2
+
+It may be easiest to start these in separate windows. You should
+see events from both suppliers on both event channels.
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname <name> -gateway <rname> -iorfile <file>
+
+ This will create a local RTEC event channel and bind it under
+ the root context of the naming service with the name <name>.
+ It will also create a gateway that links from the remote event
+ channel bound under <rname> to the locally created event channel.
+ After initializing the local event channel, it will idle until
+ it locates the remote event channel, initialize the gateway,
+ and then publish an event to the local event channel every 10
+ milliseconds. This event will contain the string <name> in the
+ any_value field. When the gateway is initialized, you'll see a
+ message stating "Gateway initialized". If you pass the -iorfile
+ parameter, this server also writes the EC's IOR to <file> when
+ the gateway is initialized.
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname <name>
+
+ This will look for an event channel bound to <name> in the Root context
+ of the Naming Service. It will consume events from this channel and
+ print the type, source, and string contents contained in any_value.
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the RtecEventComm::PushConsumer interface.
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/RTEC_Federated.mpc b/TAO/DevGuideExamples/EventServices/RTEC_Federated/RTEC_Federated.mpc
new file mode 100644
index 00000000000..718344d8d9e
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/RTEC_Federated.mpc
@@ -0,0 +1,20 @@
+project(*Supplier): namingexe, rteventexe, rtevent_serv {
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ EchoEventSupplier_i.cpp
+ }
+}
+
+project(*Consumer): namingexe, rteventexe {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/run_test.pl b/TAO/DevGuideExamples/EventServices/RTEC_Federated/run_test.pl
new file mode 100644
index 00000000000..7f2282debce
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/run_test.pl
@@ -0,0 +1,94 @@
+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;
+
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$ec1iorfile = PerlACE::LocalFile ("ec1.ior");
+$ec2iorfile = PerlACE::LocalFile ("ec2.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$iorfile";
+
+unlink $iorfile;
+unlink $ec1iorfile;
+unlink $ec2iorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $iorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Supplier
+if ( -e "supplier.conf" )
+{
+ $supplier_conf_file = "supplier.conf";
+}
+else{
+ $supplier_conf_file = "../supplier.conf";
+}
+$args1 = "-ORBSvcConf $supplier_conf_file -ecname ec1 -gateway ec2 -iorfile $ec1iorfile";
+$S1 = new PerlACE::Process("EchoEventSupplier", "$arg_ns_ref $args1");
+$S1->Spawn();
+
+$args2 = "-ORBSvcConf $supplier_conf_file -ecname ec2 -gateway ec1 -iorfile $ec2iorfile";
+$S2 = new PerlACE::Process("EchoEventSupplier", "$arg_ns_ref $args2");
+$S2->Spawn();
+
+if ((PerlACE::waitforfile_timed ($ec1iorfile, 15) == -1) ||
+ (PerlACE::waitforfile_timed ($ec2iorfile, 2) == -1)) {
+ print STDERR "ERROR: cannot find files <$ec1iorfile> and <$ec2iorfile>\n";
+ $NS->Kill();
+ $S1->Kill();
+ $S2->Kill();
+ exit 1;
+}
+
+$args3 = "-ecname ec1";
+$C1 = new PerlACE::Process("EchoEventConsumer", "$arg_ns_ref $args3");
+$C1->Spawn();
+
+$args4 = "-ecname ec2";
+$C2 = new PerlACE::Process("EchoEventConsumer", "$arg_ns_ref $args4");
+$C2->Spawn();
+
+if ($C1->WaitKill(60) == -1) {
+ print STDERR "consumer1 timedout \n";
+
+ $C2->Kill();
+ $S1->Kill();
+ $S2->Kill();
+ $NS->Kill();
+
+ unlink $iorfile;
+
+ exit 1;
+}
+
+if ($C2->WaitKill(10) == -1) {
+ print STDERR "consumer2 timedout \n";
+
+ $S1->Kill();
+ $S2->Kill();
+ $NS->Kill();
+
+ unlink $iorfile;
+
+ exit 1;
+}
+
+$NS->Kill();
+$S1->Kill();
+$S2->Kill();
+
+unlink $iorfile;
+unlink $ec1iorfile;
+unlink $ec2iorfile;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Federated/supplier.conf b/TAO/DevGuideExamples/EventServices/RTEC_Federated/supplier.conf
new file mode 100644
index 00000000000..87ebf02489e
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Federated/supplier.conf
@@ -0,0 +1,6 @@
+# $Id
+# Use 5 dispatching threads and the rw wait strategy to resolve deadlock
+# issues in the gateway at disconnect time.
+static Resource_Factory "-ORBFlushingStrategy blocking"
+static EC_Factory "-ECobserver basic -ECDispatching mt -ECDispatchingThreads 5"
+static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive"
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..c926df1a023
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumerMain.cpp
@@ -0,0 +1,91 @@
+// EchoEventConsumerMain.cpp
+// Main program for a PushConsumer of Echo events.
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const RtecEventComm::EventSourceID MY_SUPPLIER_ID_START = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventSourceID MY_SUPPLIER_ID_END = ACE_ES_EVENT_SOURCE_ANY + 3;
+const RtecEventComm::EventType MY_EVENT_START = ACE_ES_EVENT_UNDEFINED + 1;
+const RtecEventComm::EventType MY_EVENT_END = ACE_ES_EVENT_UNDEFINED + 4;
+
+const int EVENT_LIMIT = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str("EventService");
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "EchoEventConsumerMain.cpp: Found the EchoEventChannel." << std::endl;
+
+ // Obtain a reference to the consumer administration object.
+ RtecEventChannelAdmin::ConsumerAdmin_var admin = ec->for_consumers();
+
+ // Obtain a reference to the push supplier proxy.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ admin->obtain_push_supplier();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventConsumer_i servant and register it
+ // with the RootPOA
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENT_LIMIT);
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect as a consumer.
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (1);
+ qos.insert_type (MY_EVENT_START, // Event Type
+ 0); // handle to the rt_info
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "EchoEventConsumerMain.cpp: Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ // Disconnect the ProxyPushSupplier.
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..08bb270168b
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.cpp
@@ -0,0 +1,56 @@
+// EchoEventConsumer_i.cpp
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <ace/OS_NS_stdio.h>
+#include <sstream>
+
+// Constructor duplicates the ORB reference.
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+ // Nothing to do.
+}
+
+// Implement the push() operation.
+void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException)
+{
+ // Loop through the events, looking for shutdown events.
+ for (u_int i = 0; i < events.length (); ++i) {
+ //ACE_OS::printf(".");
+ // Extract event data from the any.
+ const char* eventData;
+ std::ostringstream out;
+ out << "Received event,"
+ << " type: " << events[i].header.type
+ << " source: " << events[i].header.source;
+ if (events[i].data.any_value >>= eventData) {
+ out << " text: " << eventData;
+ }
+
+ ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Implement the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..c59aa7944a8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventConsumer_i.h
@@ -0,0 +1,31 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/RtecEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_RtecEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException);
+
+ virtual void disconnect_push_consumer()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..5232c12ffd0
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplierMain.cpp
@@ -0,0 +1,118 @@
+// EchoEventSupplierMain.cpp
+// Main program for a PushSupplier of Echo events.
+
+#include "EchoEventSupplier_i.h"
+
+#include <orbsvcs/RtecEventCommC.h> // for Event Communication interfaces
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h> // for Naming Service interfaces
+
+#include <iostream>
+const RtecEventComm::EventSourceID MY_SOURCE_ID_START = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventSourceID MY_SOURCE_ID_END = ACE_ES_EVENT_SOURCE_ANY + 3;
+const RtecEventComm::EventType MY_EVENT_START = ACE_ES_EVENT_UNDEFINED + 1;
+const RtecEventComm::EventType MY_EVENT_END = ACE_ES_EVENT_UNDEFINED + 4;
+
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Get the Event Channel using Naming Services
+ obj = root_context->resolve_str("EventService");
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not resolve EchoEventChannel." << std::endl;
+ return 1;
+ }
+
+ // Get a SupplierAdmin object from the EventChannel.
+ RtecEventChannelAdmin::SupplierAdmin_var admin = ec->for_suppliers();
+
+ // Get a ProxyPushConsumer from the SupplierAdmin.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ admin->obtain_push_consumer();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventConsumer_i servant.
+ EchoEventSupplier_i servant(orb.in());
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushSupplier_var supplier =
+ RtecEventComm::PushSupplier::_narrow(supplier_obj.in());
+
+ // Publish the events the supplier provides.
+ ACE_SupplierQOS_Factory qos;
+ RtecEventComm::EventSourceID supplier_id = MY_SOURCE_ID_START;
+ for (; supplier_id <= MY_SOURCE_ID_END; ++supplier_id) {
+ RtecEventComm::EventType event_type = MY_EVENT_START;
+ for (; event_type <= MY_EVENT_END; ++event_type)
+ {
+ qos.insert (supplier_id, event_type,
+ 0, // handle to the rt_info structure
+ 1); // number of calls
+ }
+ }
+
+ // Connect as a supplier of the published events.
+ consumer->connect_push_supplier (supplier.in (), qos.get_SupplierQOS ());
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup("Hello, world.");
+
+ // Create an event set for one event
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+
+ // Initialize event header.
+ event[0].header.source = MY_SOURCE_ID_START;
+ event[0].header.type = MY_EVENT_START;
+
+ // Initialize data fields in event.
+ event[0].data.any_value <<= eventData;
+
+ std::cout << "Supplier starting sending events.\n";
+ while (1) {
+
+ event[0].header.type++;
+ if (event[0].header.type > MY_EVENT_END) {
+ event[0].header.type = MY_EVENT_START;
+ }
+ event[0].header.source++;
+ if (event[0].header.source > MY_SOURCE_ID_END) {
+ event[0].header.source = MY_SOURCE_ID_START;
+ }
+ consumer->push (event);
+
+ ACE_Time_Value tv(0, EVENT_DELAY_MS * 1000);
+ orb->run(tv);
+ }
+
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.cpp
new file mode 100644
index 00000000000..112e33922c5
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.cpp
@@ -0,0 +1,25 @@
+// EchoEventSupplier_i.cpp
+// Implements a PushSupplier.
+
+#include "EchoEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+// Constructor duplicates the ORB reference.
+EchoEventSupplier_i::EchoEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+ // Nothing to do.
+}
+
+// Override the disconnect_push_Supplier() operation.
+void EchoEventSupplier_i::disconnect_push_supplier()
+ throw(CORBA::SystemException)
+{
+
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.h b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.h
new file mode 100644
index 00000000000..b06f44cf8e3
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/EchoEventSupplier_i.h
@@ -0,0 +1,22 @@
+// EchoEventSupplier_i.h
+// Implements a PushSupplier.
+
+#ifndef _EchoEventSupplier_i_h_
+#define _EchoEventSupplier_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushSupplier
+
+class EchoEventSupplier_i : public virtual POA_RtecEventComm::PushSupplier
+{
+ public:
+ // Constructor
+ EchoEventSupplier_i(CORBA::ORB_ptr orb);
+
+ virtual void disconnect_push_supplier()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+};
+
+#endif // _EchoEventSupplier_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/README b/TAO/DevGuideExamples/EventServices/RTEC_Filter/README
new file mode 100644
index 00000000000..c1cd7a23fad
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/README
@@ -0,0 +1,57 @@
+Real-Time Event Service
+
+
+File: DevGuideExamples/EventServices/RTEC_Filter/README
+
+
+This directory contains some example code for the filters, correlations,
+and timeouts features of the RT Event service. For now the code is all
+in the EchoEventConsumerMain.cpp file. Simply, comment out the filters/
+timeouts/correlations required, remake, and run as below.
+
+-------------------------------------------------------------------------
+
+Note: To test this, you must first run the Naming Service and the
+Event Service, e.g.:
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+$TAO_ROOT/orbsvcs/Event_Service/Event_Service -ORBSvcConf ec.conf -ORBInitRef NameService=file://ns.ior&
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier -ORBInitRef NameService=file://ns.ior
+
+ It will publish an event to the event channel every 1 second.
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ORBInitRef NameService=file://ns.ior
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the RtecEventComm::PushConsumer interface.
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/RTEC_Filter.mpc b/TAO/DevGuideExamples/EventServices/RTEC_Filter/RTEC_Filter.mpc
new file mode 100644
index 00000000000..a67c5f1c819
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/RTEC_Filter.mpc
@@ -0,0 +1,20 @@
+project(*Supplier): namingexe, rteventexe, {
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ EchoEventSupplier_i.cpp
+ }
+}
+
+project(*Consumer): namingexe, rteventexe, {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/ec.conf b/TAO/DevGuideExamples/EventServices/RTEC_Filter/ec.conf
new file mode 100644
index 00000000000..0d41159fbd9
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/ec.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECFiltering prefix"
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_Filter/run_test.pl b/TAO/DevGuideExamples/EventServices/RTEC_Filter/run_test.pl
new file mode 100644
index 00000000000..c4fa28f1ec1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_Filter/run_test.pl
@@ -0,0 +1,61 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$esiorfile = PerlACE::LocalFile ("es.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+# start Naming Service
+
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Event Service
+$EventService = "$ENV{TAO_ROOT}/orbsvcs/Event_Service/Event_Service";
+$ES = new PerlACE::Process($EventService, "-o $esiorfile $arg_ns_ref");
+$ES->Spawn();
+if (PerlACE::waitforfile_timed ($esiorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$esiorfile>\n";
+ $ES->Kill();
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# start EchoEventSupplier
+$S = new PerlACE::Process("EchoEventSupplier", $arg_ns_ref);
+$S->Spawn();
+
+# start EchoEventConsumer
+$C = new PerlACE::Process("EchoEventConsumer", $arg_ns_ref);
+$C->Spawn();
+
+$CRET = $C->WaitKill(60);
+$S->Kill();
+$NS->Kill();
+$ES->Kill();
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..e3a6d584cdc
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumerMain.cpp
@@ -0,0 +1,103 @@
+// EchoEventConsumerMain.cpp
+// Main program for a PushConsumer of Echo events.
+
+#include "EchoEventConsumer_i.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include <iostream>
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+const int EVENT_LIMIT = 20;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ const char* ecname = "EventService";
+ for (int i = 0; argv[i] != 0; i++) {
+ if (strcmp(argv[i], "-ecname") == 0) {
+ if (argv[i+1] != 0) {
+ ecname = argv[i+1];
+ } else {
+ std::cerr << "Missing Event channel name" << std::endl;
+ }
+ }
+ }
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Find the EchoEventChannel.
+ obj = root_context->resolve_str(ecname);
+
+ // Downcast the object reference to an EventChannel reference.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(obj.in());
+ if (CORBA::is_nil(ec.in())) {
+ std::cerr << "Could not narrow EchoEventChannel." << std::endl;
+ return 1;
+ }
+ std::cout << "EchoEventConsumerMain.cpp: Found the EchoEventChannel." << std::endl;
+
+ // Obtain a reference to the consumer administration object.
+ RtecEventChannelAdmin::ConsumerAdmin_var admin = ec->for_consumers();
+
+ // Obtain a reference to the push supplier proxy.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ admin->obtain_push_supplier();
+
+ // Get the RootPOA.
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Instantiate an EchoEventConsumer_i servant.
+ EchoEventConsumer_i servant(orb.in(), supplier.in(), EVENT_LIMIT);
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_narrow(consumer_obj.in());
+
+ // Connect as a consumer.
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert (MY_SOURCE_ID, // Source ID
+ MY_EVENT_TYPE, // Event Type
+ 0); // handle to the rt_info
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ());
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+ poa_manager->activate();
+
+ std::cout << "EchoEventConsumerMain.cpp: Ready to receive events..." << std::endl;
+
+ // Enter the ORB event loop.
+ orb->run();
+
+ // If we have reached this, we must be shutting down...
+ // Disconnect the ProxyPushSupplier.
+ orb->destroy();
+
+ return 0;
+
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..08bb270168b
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
@@ -0,0 +1,56 @@
+// EchoEventConsumer_i.cpp
+// Implements a PushConsumer.
+
+#include "EchoEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <ace/OS_NS_stdio.h>
+#include <sstream>
+
+// Constructor duplicates the ORB reference.
+EchoEventConsumer_i::EchoEventConsumer_i(
+ CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , supplier_(RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(supplier))
+ , event_limit_(event_limit)
+{
+ // Nothing to do.
+}
+
+// Implement the push() operation.
+void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException)
+{
+ // Loop through the events, looking for shutdown events.
+ for (u_int i = 0; i < events.length (); ++i) {
+ //ACE_OS::printf(".");
+ // Extract event data from the any.
+ const char* eventData;
+ std::ostringstream out;
+ out << "Received event,"
+ << " type: " << events[i].header.type
+ << " source: " << events[i].header.source;
+ if (events[i].data.any_value >>= eventData) {
+ out << " text: " << eventData;
+ }
+
+ ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
+ }
+ if (--event_limit_ <= 0) {
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ }
+}
+
+// Implement the disconnect_push_consumer() operation.
+void EchoEventConsumer_i::disconnect_push_consumer()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..c59aa7944a8
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventConsumer_i.h
@@ -0,0 +1,31 @@
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushConsumer
+#include <orbsvcs/RtecEventChannelAdminC.h>
+
+class EchoEventConsumer_i : public virtual POA_RtecEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr supplier,
+ int event_limit);
+
+ // Override operations from PushConsumer interface.
+ virtual void push(const RtecEventComm::EventSet& events)
+ throw(CORBA::SystemException);
+
+ virtual void disconnect_push_consumer()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..1ea25b53d15
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
@@ -0,0 +1,243 @@
+// EchoEventSupplierMain.cpp
+// Main program for a PushSupplier of Echo events.
+
+#include "EchoEventSupplier_i.h"
+#include "SimpleAddressServer.h"
+
+#include <orbsvcs/RtecEventCommC.h>
+#include <orbsvcs/RtecEventChannelAdminC.h>
+#include <orbsvcs/Time_Utilities.h>
+#include <orbsvcs/Event_Utilities.h>
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/Event/EC_Event_Channel.h>
+#include <orbsvcs/Event/EC_Default_Factory.h>
+#include <orbsvcs/Event/ECG_Mcast_EH.h>
+#include <orbsvcs/Event/ECG_UDP_Sender.h>
+#include <orbsvcs/Event/ECG_UDP_Receiver.h>
+#include <orbsvcs/Event/ECG_UDP_Out_Endpoint.h>
+#include <orbsvcs/Event/ECG_UDP_EH.h>
+
+#include <tao/ORB_Core.h>
+
+#include <ace/Auto_Ptr.h>
+#include <iostream>
+#include <fstream>
+
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+const int EVENT_DELAY_MS = 10;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the EC Factory so we can customize the EC
+ TAO_EC_Default_Factory::init_svcs ();
+
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ const char* ecname = "EventService";
+ const char* address = "localhost";
+ const char* iorfile = 0;
+ u_short port = 12345;
+ u_short listenport = 12345;
+ int mcast = 1;
+
+ for (int i = 0; argv[i] != 0; i++) {
+ if (strcmp(argv[i], "-ecname") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ ecname = argv[i];
+ } else {
+ std::cerr << "Missing Event channel name" << std::endl;
+ }
+ } else if (strcmp(argv[i], "-address") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ address = argv[i];
+ } else {
+ std::cerr << "Missing address" << std::endl;
+ }
+ } else if (strcmp(argv[i], "-port") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ port = ACE_OS::atoi(argv[i]);
+ } else {
+ std::cerr << "Missing port" << std::endl;
+ }
+ } else if (strcmp(argv[i], "-listenport") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ listenport = ACE_OS::atoi(argv[i]);
+ } else {
+ std::cerr << "Missing port" << std::endl;
+ }
+ } else if (strcmp(argv[i], "-iorfile") == 0) {
+ if (argv[i+1] != 0) {
+ i++;
+ iorfile = argv[i];
+ }
+ } else if (strcmp(argv[i], "-udp") == 0) {
+ mcast = 0;
+ }
+ }
+
+ // Get the POA
+ CORBA::Object_var object = orb->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (object.in ());
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager ();
+ poa_manager->activate ();
+
+ // Create a local event channel and register it
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (), poa.in ());
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate ();
+ PortableServer::ObjectId_var oid = poa->activate_object(&ec_impl);
+ CORBA::Object_var ec_obj = poa->id_to_reference(oid.in());
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in());
+
+ // Find the Naming Service.
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root_context = CosNaming::NamingContextExt::_narrow(obj.in());
+
+ // Bind the Event Channel using Naming Services
+ CosNaming::Name_var name = root_context->to_name(ecname);
+ root_context->rebind(name.in(), ec.in());
+
+ // Get a proxy push consumer from the EventChannel.
+ RtecEventChannelAdmin::SupplierAdmin_var admin = ec->for_suppliers();
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ admin->obtain_push_consumer();
+
+ // Instantiate an EchoEventSupplier_i servant.
+ EchoEventSupplier_i servant(orb.in());
+
+ // Register it with the RootPOA.
+ oid = poa->activate_object(&servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ RtecEventComm::PushSupplier_var supplier =
+ RtecEventComm::PushSupplier::_narrow(supplier_obj.in());
+
+ // Connect to the EC.
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (MY_SOURCE_ID, MY_EVENT_TYPE, 0, 1);
+ consumer->connect_push_supplier (supplier.in (), qos.get_SupplierQOS ());
+
+ // Initialize the address server with the desired address.
+ // This will be used by the sender object and the multicast
+ // receiver.
+ ACE_INET_Addr send_addr (port, address);
+ SimpleAddressServer addr_srv_impl (send_addr);
+
+ PortableServer::ObjectId_var addr_srv_oid =
+ poa->activate_object(&addr_srv_impl);
+ CORBA::Object_var addr_srv_obj = poa->id_to_reference(addr_srv_oid.in());
+ RtecUDPAdmin::AddrServer_var addr_srv =
+ RtecUDPAdmin::AddrServer::_narrow(addr_srv_obj.in());
+
+ // Create and initialize the sender object
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender =
+ TAO_ECG_UDP_Sender::create();
+ TAO_ECG_UDP_Out_Endpoint endpoint;
+ if (endpoint.dgram ().open (ACE_Addr::sap_any) == -1) {
+ std::cerr << "Cannot open send endpoint" << std::endl;
+ return 1;
+ }
+
+ // TAO_ECG_UDP_Sender::init() takes a TAO_ECG_Refcounted_Endpoint.
+ // If we don't clone our endpoint and pass &endpoint, the sender will
+ // attempt to delete endpoint during shutdown.
+ TAO_ECG_UDP_Out_Endpoint* clone;
+ ACE_NEW_RETURN (clone,
+ TAO_ECG_UDP_Out_Endpoint (endpoint),
+ -1);
+ sender->init (ec.in (), addr_srv.in (), clone);
+
+ // Setup the subscription and connect to the EC
+ ACE_ConsumerQOS_Factory cons_qos_fact;
+ cons_qos_fact.start_disjunction_group ();
+ cons_qos_fact.insert (ACE_ES_EVENT_SOURCE_ANY, ACE_ES_EVENT_ANY, 0);
+ RtecEventChannelAdmin::ConsumerQOS sub = cons_qos_fact.get_ConsumerQOS ();
+ sender->connect (sub);
+
+ // Create and initialize the receiver
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver =
+ TAO_ECG_UDP_Receiver::create();
+
+ // TAO_ECG_UDP_Receiver::init() takes a TAO_ECG_Refcounted_Endpoint.
+ // If we don't clone our endpoint and pass &endpoint, the receiver will
+ // attempt to delete endpoint during shutdown.
+ ACE_NEW_RETURN (clone,
+ TAO_ECG_UDP_Out_Endpoint (endpoint),
+ -1);
+ receiver->init (ec.in (), clone, addr_srv.in ());
+
+ // Setup the registration and connect to the event channel
+ ACE_SupplierQOS_Factory supp_qos_fact;
+ supp_qos_fact.insert (MY_SOURCE_ID, MY_EVENT_TYPE, 0, 1);
+ RtecEventChannelAdmin::SupplierQOS pub = supp_qos_fact.get_SupplierQOS ();
+ receiver->connect (pub);
+
+ // Create the appropriate event handler and register it with the reactor
+ auto_ptr<ACE_Event_Handler> eh;
+ if (mcast) {
+ auto_ptr<TAO_ECG_Mcast_EH> mcast_eh(new TAO_ECG_Mcast_EH (receiver.in()));
+ mcast_eh->reactor (orb->orb_core ()->reactor ());
+ mcast_eh->open (ec.in());
+ ACE_AUTO_PTR_RESET(eh,mcast_eh.release(),ACE_Event_Handler);
+ //eh.reset(mcast_eh.release());
+ } else {
+ auto_ptr<TAO_ECG_UDP_EH> udp_eh (new TAO_ECG_UDP_EH (receiver.in()));
+ udp_eh->reactor (orb->orb_core ()->reactor ());
+ ACE_INET_Addr local_addr (listenport);
+ if (udp_eh->open (local_addr) == -1) {
+ std::cerr << "Cannot open EH" << std::endl;
+ }
+ ACE_AUTO_PTR_RESET(eh,udp_eh.release(),ACE_Event_Handler);
+ //eh.reset(udp_eh.release());
+ }
+
+ // Create an event (just a string in this case).
+ const CORBA::String_var eventData = CORBA::string_dup(ecname);
+
+ // Create an event set for one event
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+
+ // Initialize event header.
+ event[0].header.source = MY_SOURCE_ID;
+ event[0].header.ttl = 1;
+ event[0].header.type = MY_EVENT_TYPE;
+
+ // Initialize data fields in event.
+ event[0].data.any_value <<= eventData;
+
+ if (iorfile != 0) {
+ CORBA::String_var str = orb->object_to_string( ec.in() );
+ std::ofstream iorFile( iorfile );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ }
+ std::cout << "Starting main loop" << std::endl;
+
+ const int EVENT_DELAY_MS = 10;
+
+ while (1) {
+ consumer->push (event);
+
+ ACE_Time_Value tv(0, 1000 * EVENT_DELAY_MS);
+ orb->run(tv);
+ }
+
+ orb->destroy();
+ return 0;
+ }
+ catch(const CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp
new file mode 100644
index 00000000000..c2339c37ad1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.cpp
@@ -0,0 +1,24 @@
+// EchoEventSupplier_i.cpp
+// Implements a PushSupplier.
+
+#include "EchoEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+// Constructor duplicates the ORB reference.
+EchoEventSupplier_i::EchoEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+ // Nothing to do.
+}
+
+// Override the disconnect_push_Supplier() operation.
+void EchoEventSupplier_i::disconnect_push_supplier()
+ throw(CORBA::SystemException)
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.h b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.h
new file mode 100644
index 00000000000..b06f44cf8e3
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplier_i.h
@@ -0,0 +1,22 @@
+// EchoEventSupplier_i.h
+// Implements a PushSupplier.
+
+#ifndef _EchoEventSupplier_i_h_
+#define _EchoEventSupplier_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushSupplier
+
+class EchoEventSupplier_i : public virtual POA_RtecEventComm::PushSupplier
+{
+ public:
+ // Constructor
+ EchoEventSupplier_i(CORBA::ORB_ptr orb);
+
+ virtual void disconnect_push_supplier()
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+};
+
+#endif // _EchoEventSupplier_i_h_
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/README b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/README
new file mode 100644
index 00000000000..27b6aaee1e1
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/README
@@ -0,0 +1,138 @@
+Real-Time Event Service
+
+
+File: DevGuideExamples/EventServices/RTEC_MCast_Federated/README
+
+
+This directory contains an example that shows how to create and
+federate real-time event channels using the classes in EC_Gateway_UDP.h.
+Depending on the options, it will use either UDP or multicast to link
+the event channels.
+
+-------------------------------------------------------------------------
+
+Note: To run this example, you must first run the Naming Service, e.g.:
+
+ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+-------------------------------------------------------------------------
+
+To start the supplier/EC processes on a single host and federate them
+using UDP, do the following (after starting the Naming_Service):
+
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name1 -port 1233 -listenport 1234
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name2 -port 1234 -listenport 1233
+
+This will start two EC/supplier processes on the same node. One (name1)
+will listen on port 1234 and send on port 1233. The other (name2) will
+do the opposite. You should be able to use any available port as long as
+the port and listenport options are symmetric (listenport of one process
+must be the port of the other). The -address option can be used to
+specify a supplier/EC process on another host. Here is an example of two
+processes on different hosts:
+
+On node1:
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name1 -port 1233 -listenport 1234 -address node2
+On node2:
+ ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name2 -port 1234 -listenport 1233 -address node1
+
+When using UDP, this example is limited to federating two ECs.
+
+-------------------------------------------------------------------------
+
+To start the supplier/EC processes and federate them using multicast, do the
+following (after starting the Naming_Service):
+
+./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name1 -address 224.9.9.2 -port 1234
+./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name2 -address 224.9.9.2 -port 1234
+
+The -address and -port options should be passed a valid and available
+multicast address and port.
+
+-------------------------------------------------------------------------
+
+To start the consumers, simply do the following (this works the same for
+both types of federations):
+
+./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name1
+./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name2
+
+It may be easiest to start these in separate windows. Each consumer
+connects to one EC (specified by the -ecname option). You should see
+events from both suppliers on each event channel (each supplier passes
+events containing with the name of the EC they are using).
+
+-------------------------------------------------------------------------
+
+EchoEventSupplerMain.cpp
+
+ Main program for a PushSupplier.
+
+ EchoEventSupplier [ -ORBSvcConf supplier.conf ] [ -udp ] -ecname <name>
+ [ -address <address> ] [ -port <port> ]
+ [ -listenport <lport> ]
+
+ This will create a local RTEC event channel and bind it under
+ the root context of the naming service with the name <name>.
+ It will also federate with remote event channels specified via
+ the other options. By default, it uses multicast to federate
+ the ECs (specifying -udp forces use of UDP). <address> is
+ the address of the remote EC when using UDP and the multicast
+ address when using multicast. <port> is the port to send
+ to when using UDP and the multicast port when using multicast.
+ <lport> is the port to listen on for UDP (and not used by
+ multicast. You must pass -ORBSvcConf supplier.conf when
+ using multicast so as to enable Observers.
+
+ After initializing the local event channel and setting up the
+ connection for the federation, it publishes an event to the
+ local event channel every 10 milliseconds. This event will
+ contain the string <name> in the any_value field.
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumerMain.cpp
+
+ Main program for a PushConsumer.
+
+ To run it:
+
+ EchoEventConsumer -ecname <name>
+
+ This will look for an event channel bound to <name> in the Root context
+ of the Naming Service. It will consume events from this channel and
+ print the type, source, and string contents contained in any_value.
+
+ Use Control-C to kill the process.
+
+-------------------------------------------------------------------------
+
+EchoEventConsumer_i.{h,cpp}
+
+ Call which implements the RtecEventComm::PushConsumer interface.
+
+-------------------------------------------------------------------------
+
+SimpleAddressServer.{h,cpp}
+
+ This is a servant class that implements the RtecUDPAdmin::AddrServer
+ interface. It is used by the UDP/multicast senders to return an
+ address that they will send out particular events on. It is also
+ used by the multicast event handler, to determine which addresses
+ to listen to based on consumer subscriptions. This simple
+ implementation always returns the same address.
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+By default, this script uses multicast; pass -udp to the
+script to use udp.
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc
new file mode 100644
index 00000000000..373818b574d
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc
@@ -0,0 +1,21 @@
+project(*_Dev_Supplier): namingexe, rteventexe, rtevent_serv {
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ EchoEventSupplier_i.cpp
+ SimpleAddressServer.cpp
+ }
+}
+
+project(*_Dev_Consumer): namingexe, rteventexe {
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp
new file mode 100644
index 00000000000..8e593774e67
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.cpp
@@ -0,0 +1,41 @@
+// SimpleAddressServer.cpp
+
+#include "SimpleAddressServer.h"
+#include <ace/INET_Addr.h>
+#include <ace/OS_NS_string.h>
+
+SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) {
+#if defined (ACE_HAS_IPV6)
+ if (address.get_type() == PF_INET6)
+ {
+ RtecUDPAdmin::UDP_Addr_v6 v6;
+ sockaddr_in6 *in6 =
+ reinterpret_cast<sockaddr_in6 *>(address.get_addr());
+ ACE_OS::memcpy (v6.ipaddr,&in6->sin6_addr,16);
+ v6.port = address.get_port_number();
+ this->address_.v6_addr (v6);
+ return;
+ }
+#endif /* ACE_HAS_IPV6 */
+ RtecUDPAdmin::UDP_Addr v4;
+ v4.ipaddr = address.get_ip_address ();
+ v4.port = address.get_port_number ();
+ this->address_.v4_addr (v4);
+}
+
+void
+SimpleAddressServer::get_addr (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Addr& address)
+ throw (CORBA::SystemException) {
+ if (this->address_._d() == RtecUDPAdmin::Rtec_inet6)
+ throw CORBA::DATA_CONVERSION(0, CORBA::COMPLETED_YES);
+ address = this->address_.v4_addr();
+}
+
+void
+SimpleAddressServer::get_address(const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Address& address)
+ throw (CORBA::SystemException)
+{
+ address = this->address_;
+}
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.h b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.h
new file mode 100644
index 00000000000..ae92a697c0e
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/SimpleAddressServer.h
@@ -0,0 +1,27 @@
+// SimpleAddressServer.h
+
+#ifndef SIMPLEADDRESSSERVER_H
+#define SIMPLEADDRESSSERVER_H
+
+#include <orbsvcs/RtecUDPAdminS.h>
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_INET_Addr;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+class SimpleAddressServer : public POA_RtecUDPAdmin::AddrServer {
+public:
+ SimpleAddressServer (const ACE_INET_Addr& address);
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr& address)
+ throw (CORBA::SystemException);
+
+ virtual void get_address(const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Address& address)
+ throw (CORBA::SystemException);
+
+private:
+ RtecUDPAdmin::UDP_Address address_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/run_test.pl b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/run_test.pl
new file mode 100644
index 00000000000..350558eb25b
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/run_test.pl
@@ -0,0 +1,144 @@
+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;
+
+if (!defined $ENV{TAO_ROOT}) {
+ $ENV{TAO_ROOT} = "$ENV{ACE_ROOT}/TAO";
+}
+
+sub usage() {
+ print "Usage:\n";
+ print " run_test [-h] [-debug]\n\n";
+ print " -udp -- Federate using udp\n";
+ print " -mcast -- Federate using multicast (the default)\n";
+ print " -h -- Prints this information\n";
+ print " -debug -- Sets the debug flag for the test\n";
+ exit;
+}
+
+my $udp = 0;
+my $i = 0;
+my $flags = "";
+while ($i <= $#ARGV) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-help" ||
+ $ARGV[$i] eq "--help" || $ARGV[$i] eq "-?") {
+ usage ();
+ } elsif ($ARGV[$i] eq "-debug") {
+ $flags .= " -ORBDebugLevel 10 ";
+ } elsif ($ARGV[$i] eq "-udp") {
+ $udp = 1;
+ } elsif ($ARGV[$i] eq "-mcast") {
+ $udp = 0;
+ } else {
+ print "ERROR: Unknown Option: ".$ARGV[$i]."\n\n";
+ usage ();
+ }
+ $i++;
+}
+
+if ($udp) {
+ print "Using UDP to link the event channels.\n\n";
+} else {
+ print "Using multicast to link the event channels.\n\n";
+}
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$ec1iorfile = PerlACE::LocalFile ("ec1.ior");
+$ec2iorfile = PerlACE::LocalFile ("ec2.ior");
+
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+$end_point = "-ORBEndpoint iiop://localhost";
+$ns_port = PerlACE::random_port();
+
+unlink $nsiorfile;
+unlink $ec1iorfile;
+unlink $ec2iorfile;
+
+# start Naming Service
+
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "$flags -o $nsiorfile $end_point:$ns_port");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start EchoEventSupplier
+my($port1) = 10001 + PerlACE::uniqueid() ;
+my($port2) = 10001 + PerlACE::uniqueid() ;
+my($mport) = 10001 + PerlACE::uniqueid() ;
+if ( -e "supplier.conf" )
+{
+ $supplier_conf_file = "supplier.conf";
+}
+else{
+ $supplier_conf_file = "../supplier.conf";
+}
+
+$args1 = "$flags $arg_ns_ref -ORBSvcConf $supplier_conf_file $end_point -iorfile $ec1iorfile";
+if ($udp) {
+ $args1 .= " -udp -ecname ec1 -port $port1 -listenport $port2 ";
+} else {
+ $args1 .= " -ecname ec1 -address 224.9.9.2 -port $mport ";
+}
+$S1 = new PerlACE::Process("EchoEventSupplier", $args1);
+$S1->Spawn();
+
+$args2 = "$flags $arg_ns_ref -ORBSvcConf $supplier_conf_file $end_point -iorfile $ec2iorfile";
+if ($udp) {
+ $args2 .= " -udp -ecname ec2 -port $port2 -listenport $port1 ";
+} else {
+ $args2 .= " -ecname ec2 -address 224.9.9.2 -port $mport ";
+}
+$S2 = new PerlACE::Process("EchoEventSupplier", $args2);
+$S2->Spawn();
+
+if ((PerlACE::waitforfile_timed ($ec1iorfile, 15) == -1) ||
+ (PerlACE::waitforfile_timed ($ec2iorfile, 2) == -1)) {
+ print STDERR "ERROR: cannot find files <$ec1iorfile> and <$ec2iorfile>\n";
+ $NS->Kill();
+ $S1->Kill();
+ $S2->Kill();
+ exit 1;
+}
+
+$args3 = "$flags $arg_ns_ref -ecname ec1 $end_point";
+$C1 = new PerlACE::Process("EchoEventConsumer", $args3);
+$C1->Spawn();
+
+
+$args4 = "$flags $arg_ns_ref -ecname ec2 $end_point";
+$C2 = new PerlACE::Process("EchoEventConsumer", $args4);
+$C2->Spawn();
+
+if ($C1->WaitKill(30) == -1) {
+ $S1->Kill();
+ $S2->Kill();
+ $NS->Kill();
+ $C2->Kill();
+
+ exit 1;
+}
+
+if ($C2->WaitKill(5) == -1) {
+ $S1->Kill();
+ $S2->Kill();
+ $NS->Kill();
+ exit 1;
+}
+
+$NS->Kill();
+$S1->Kill();
+$S2->Kill();
+
+unlink $nsiorfile;
+unlink $ec1iorfile;
+unlink $ec2iorfile;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/supplier.conf b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/supplier.conf
new file mode 100644
index 00000000000..d9eeea24f43
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/supplier.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECobserver basic"
diff --git a/TAO/DevGuideExamples/GettingStarted/GettingStarted.mpc b/TAO/DevGuideExamples/GettingStarted/GettingStarted.mpc
new file mode 100644
index 00000000000..3660526de6b
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/GettingStarted.mpc
@@ -0,0 +1,17 @@
+project(*Server): taoexe, portableserver {
+ idlflags += -Wb,pch_include=started_pch.h
+
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe {
+ idlflags += -Wb,pch_include=started_pch.h
+
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/GettingStarted/Messenger.idl b/TAO/DevGuideExamples/GettingStarted/Messenger.idl
new file mode 100644
index 00000000000..335d899f058
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/Messenger.idl
@@ -0,0 +1,8 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/GettingStarted/MessengerClient.cpp b/TAO/DevGuideExamples/GettingStarted/MessengerClient.cpp
new file mode 100644
index 00000000000..36687e6a31c
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/MessengerClient.cpp
@@ -0,0 +1,40 @@
+#include "started_pch.h"
+
+#include "MessengerC.h"
+#include <iostream>
+
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var msg = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", msg.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << msg.in() << std::endl;
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/GettingStarted/MessengerServer.cpp b/TAO/DevGuideExamples/GettingStarted/MessengerServer.cpp
new file mode 100644
index 00000000000..6afe84f8d5c
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/MessengerServer.cpp
@@ -0,0 +1,45 @@
+#include "started_pch.h"
+
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Messenger_i servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid = poa->activate_object( &servant );
+ obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/GettingStarted/Messenger_i.cpp b/TAO/DevGuideExamples/GettingStarted/Messenger_i.cpp
new file mode 100644
index 00000000000..2e6a819f7d2
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/Messenger_i.cpp
@@ -0,0 +1,36 @@
+#include "started_pch.h"
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean
+Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::string_free(message);
+ message = CORBA::string_dup("Thanks for the message.");
+ return true;
+}
+
diff --git a/TAO/DevGuideExamples/GettingStarted/Messenger_i.h b/TAO/DevGuideExamples/GettingStarted/Messenger_i.h
new file mode 100644
index 00000000000..4af885c4b50
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/GettingStarted/README b/TAO/DevGuideExamples/GettingStarted/README
new file mode 100644
index 00000000000..1ae24245c7b
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/README
@@ -0,0 +1,43 @@
+File: DevGuideExamples/GettingStarted/README
+
+
+This directory contains a CORBA example illustrating a simple client and
+a server with a Interface Messenger. The Messenger Interface has
+an operation for sending a message (send_message). The MessengerClient
+will send a message which is displayed by the MessengerServer when
+received. The MessengerClient will then confirm that the message has
+been sent successfully.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/GettingStarted/run_test.pl b/TAO/DevGuideExamples/GettingStarted/run_test.pl
new file mode 100644
index 00000000000..7c83927dfc1
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/run_test.pl
@@ -0,0 +1,44 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+# start MessengerServer
+
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C = new PerlACE::Process("MessengerClient");
+$C->Spawn();
+
+$CRET = $C->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/GettingStarted/started_pch.cpp b/TAO/DevGuideExamples/GettingStarted/started_pch.cpp
new file mode 100644
index 00000000000..c7253a683cd
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/started_pch.cpp
@@ -0,0 +1 @@
+#include "started_pch.h"
diff --git a/TAO/DevGuideExamples/GettingStarted/started_pch.h b/TAO/DevGuideExamples/GettingStarted/started_pch.h
new file mode 100644
index 00000000000..1b4e8d10348
--- /dev/null
+++ b/TAO/DevGuideExamples/GettingStarted/started_pch.h
@@ -0,0 +1,10 @@
+#ifndef PCH_H
+#define PCH_H
+
+#ifdef USING_PCH
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+#include <tao/Stub.h>
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/ImplRepo/Activator/run_test.pl b/TAO/DevGuideExamples/ImplRepo/Activator/run_test.pl
new file mode 100644
index 00000000000..da22251c496
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Activator/run_test.pl
@@ -0,0 +1,121 @@
+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;
+use Sys::Hostname;
+
+my $WAIT_TIMEOUT = 2;
+my $DEBUG_LEVEL = 1;
+my $OBJ_REF_STYLE = "-orbobjrefstyle url";
+
+my $implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImplRepo_Service";
+my $imr_activator = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImR_Activator";
+my $tao_imr = "$ENV{ACE_ROOT}/bin/tao_imr";
+
+my $implrepo_ior = "imr.ior";
+my $activator_ior = "activator.ior";
+my $messenger_ior = "messenger.ior";
+
+my $imr_init_ref = "-ORBInitRef ImplRepoService=file://$implrepo_ior";
+
+my $Svr = new PerlACE::Process('../Basic/MessengerServer', "-orbuseimr 1 $OBJ_REF_STYLE $imr_init_ref");
+my $Cli = new PerlACE::Process('../Basic/MessengerClient');
+
+my $server_cmd = $Svr->Executable();
+
+sub CleanupOutput {
+ unlink $messenger_ior;
+ unlink $implrepo_ior;
+ unlink $activator_ior;
+}
+
+sub SpawnWait {
+ my $process = shift;
+ my $file = shift;
+
+ print ">>> " . $process->CommandLine() . "\n";
+ $process->Spawn();
+ my $ret = PerlACE::waitforfile_timed($file, $WAIT_TIMEOUT);
+ if ($ret == -1) {
+ print STDERR "ERROR: Cannot find file <$file>\n";
+ }
+ return $ret;
+}
+
+# Use url object reference style for readability, and startup timeout of 2 seconds.
+# Unlike the chapter we'll forgo using -m, because we want to be able to run this
+# as a test in our nightly builds, and multicast could interfere with other machines.
+my $ImR = new PerlACE::Process ($implrepo_server, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -t 2 -o $implrepo_ior");
+my $Act = new PerlACE::Process ($imr_activator, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -o $activator_ior $imr_init_ref");
+
+my $imr_util = new PerlACE::Process ("$tao_imr");
+# We want the tao_imr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+$imr_util->IgnoreExeSubDir(1);
+
+sub RunImRUtil {
+ my $cmd = shift;
+ print ">>> " . $imr_util->CommandLine() . "\n";
+ $imr_util->Arguments("$imr_init_ref $cmd");
+ return $imr_util->SpawnWaitKill(5);
+}
+
+CleanupOutput();
+
+#### Start the example
+
+if (SpawnWait($ImR, $implrepo_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+if (SpawnWait($Act, $activator_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+#instead of using tao_imr add, we'll use tao_imr update, because
+#we want to run the server once to generate the ior file.
+
+if (SpawnWait($Svr, $messenger_ior) != 0) {
+ $Act->Kill();
+ $ImR->Kill();
+ exit 1;
+}
+
+RunImRUtil("list -v");
+
+RunImRUtil("shutdown MessengerService");
+$Svr->WaitKill($WAIT_TIMEOUT);
+
+RunImRUtil("list -v");
+
+# Note : If the server registers itself, then it won't set the
+# activator name. If we don't set it here, then the activator
+# won't be able to start the server.
+my $actname = hostname;
+RunImRUtil("update MessengerService -l $actname -c \"$server_cmd $OBJ_REF_STYLE -ORBUseIMR 1 $imr_init_ref\"");
+
+RunImRUtil("list -v");
+
+if ($Cli->SpawnWaitKill(1000) != 0) {
+ print STDERR "Error : Client failed to run correctly.";
+}
+
+$Act->Kill();
+
+RunImRUtil("list -v");
+
+RunImRUtil("shutdown MessengerService");
+
+$ImR->Kill();
+
+#### Clean up any output files
+
+CleanupOutput();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/ImplRepo_Basic.mpc b/TAO/DevGuideExamples/ImplRepo/Basic/ImplRepo_Basic.mpc
new file mode 100644
index 00000000000..4bd5d1438bd
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/ImplRepo_Basic.mpc
@@ -0,0 +1,13 @@
+project(*Server): taoexe, portableserver, avoids_minimum_corba, avoids_corba_e_micro {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, anytypecode, avoids_minimum_corba {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/Messenger.idl b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger.idl
new file mode 100644
index 00000000000..2c75f1cb614
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger.idl
@@ -0,0 +1,3 @@
+interface Messenger {
+ boolean send_message (in string user_name, in string subject, inout string message);
+};
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/MessengerClient.cpp b/TAO/DevGuideExamples/ImplRepo/Basic/MessengerClient.cpp
new file mode 100644
index 00000000000..550b6acc92e
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/MessengerClient.cpp
@@ -0,0 +1,26 @@
+#include "MessengerC.h"
+#include <iostream>
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) {
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object("file://messenger.ior");
+
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Unable to get a Messenger reference." << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+ messenger->send_message("TAO User", "TAO Test", message.inout());
+ std::cout << "message was sent" << std::endl;
+ std::cout << "Reply was : " << message.in() << std::endl;
+
+ return 0;
+ } catch(const CORBA::Exception& ex) {
+ std::cerr << "Client main() Caught Exception: " << ex << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/MessengerServer.cpp b/TAO/DevGuideExamples/ImplRepo/Basic/MessengerServer.cpp
new file mode 100644
index 00000000000..97acc809411
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/MessengerServer.cpp
@@ -0,0 +1,74 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+
+
+PortableServer::POA_ptr
+createPersistentPOA(PortableServer::POA_ptr root_poa,
+ const char* poa_name)
+{
+ CORBA::PolicyList policies;
+ policies.length(2);
+
+ policies[0] = root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
+ policies[1] = root_poa->create_id_assignment_policy(PortableServer::USER_ID);
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+ PortableServer::POA_var poa =
+ root_poa->create_POA(poa_name, mgr.in(), policies);
+
+ policies[0]->destroy();
+ policies[1]->destroy();
+
+ return poa._retn();
+}
+
+void writeIORFile(const char* ior) {
+ std::ofstream out("messenger.ior");
+ out << ior;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+
+ const char* poa_name = "MessengerService";
+
+ PortableServer::POA_var poa = createPersistentPOA(root_poa.in(), poa_name);
+
+ Messenger_i servant;
+
+ PortableServer::ObjectId_var object_id =
+ PortableServer::string_to_ObjectId("object");
+
+ poa->activate_object_with_id(object_id.in(), &servant);
+
+ obj = poa->id_to_reference(object_id.in());
+ CORBA::String_var ior = orb->object_to_string(obj.in());
+
+ writeIORFile(ior.in());
+
+ mgr->activate();
+
+ std::cout << "Messenger server ready." << std::endl;
+
+ orb->run();
+
+ std::cout << "Messenger server shutting down." << std::endl;
+
+ root_poa->destroy(1,1);
+ orb->destroy();
+
+ return 0;
+ } catch(const CORBA::Exception& ex) {
+ std::cerr << "Server main() Caught Exception" << ex << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.cpp b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.cpp
new file mode 100644
index 00000000000..c224376be09
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.cpp
@@ -0,0 +1,16 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <exception>
+
+CORBA::Boolean Messenger_i::send_message(
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ std::cout << "Message from: " << user_name << std::endl
+ << "Subject: " << subject << std::endl
+ << "Message: " << message << std::endl;
+ message = CORBA::string_dup("A reply.");
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.h b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.h
new file mode 100644
index 00000000000..af61f133d87
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/Messenger_i.h
@@ -0,0 +1,17 @@
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+class Messenger_i : public virtual POA_Messenger
+{
+ int count;
+public:
+ Messenger_i() : count(0) {}
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/ImplRepo/Basic/run_test.pl b/TAO/DevGuideExamples/ImplRepo/Basic/run_test.pl
new file mode 100644
index 00000000000..e6f49f05aad
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Basic/run_test.pl
@@ -0,0 +1,92 @@
+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;
+
+my $WAIT_TIMEOUT = 2;
+my $DEBUG_LEVEL = 1;
+my $OBJ_REF_STYLE = "-orbobjrefstyle url";
+
+my $implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImplRepo_Service";
+my $imr_activator = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImR_Activator";
+my $tao_imr = "$ENV{ACE_ROOT}/bin/tao_imr";
+
+my $implrepo_ior = "imr.ior";
+my $activator_ior = "activator.ior";
+my $messenger_ior = "messenger.ior";
+
+my $imr_init_ref = "-ORBInitRef ImplRepoService=file://$implrepo_ior";
+
+my $Svr = new PerlACE::Process('MessengerServer', "-orbuseimr 1 $OBJ_REF_STYLE $imr_init_ref");
+my $Cli = new PerlACE::Process('MessengerClient');
+
+sub CleanupOutput {
+ unlink $messenger_ior;
+ unlink $implrepo_ior;
+ unlink $activator_ior;
+}
+
+sub SpawnWait {
+ my $process = shift;
+ my $file = shift;
+
+ print ">>> " . $process->CommandLine() . "\n";
+ $process->Spawn();
+ my $ret = PerlACE::waitforfile_timed($file, $WAIT_TIMEOUT);
+ if ($ret == -1) {
+ print STDERR "ERROR: Cannot find file <$file>\n";
+ }
+ return $ret;
+}
+
+# Use url object reference style for readability, and startup timeout of 2 seconds.
+# Unlike the chapter we'll forgo using -m, because we want to be able to run this
+# as a test in our nightly builds, and multicast could interfere with other machines.
+my $ImR = new PerlACE::Process ($implrepo_server, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -t 2 -o $implrepo_ior");
+my $Act = new PerlACE::Process ($imr_activator, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -o $activator_ior $imr_init_ref");
+
+my $imr_util = new PerlACE::Process ("$tao_imr",
+ "$imr_init_ref add MessengerService -c \"$Svr->Executable() $OBJ_REF_STYLE -ORBUseIMR 1 $imr_init_ref\"");
+
+# We want the tao_imr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+$imr_util->IgnoreExeSubDir(1);
+
+sub RunImRUtil {
+ my $cmd = shift;
+ print ">>> " . $imr_util->CommandLine() . "\n";
+ $imr_util->Arguments("$imr_init_ref $cmd");
+ return $imr_util->SpawnWaitKill(5);
+}
+
+CleanupOutput();
+
+#### Start the example
+
+if (SpawnWait($ImR, $implrepo_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+if (SpawnWait($Svr, $messenger_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+if ($Cli->SpawnWaitKill($WAIT_TIMEOUT) != 0) {
+ print STDERR "Error : Client failed to run correctly.";
+}
+
+$Svr->Kill();
+$ImR->Kill();
+
+
+#### Clean up any output files
+
+CleanupOutput();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/ImplRepo_IORTable.mpc b/TAO/DevGuideExamples/ImplRepo/IORTable/ImplRepo_IORTable.mpc
new file mode 100644
index 00000000000..881362f4ab3
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/ImplRepo_IORTable.mpc
@@ -0,0 +1,13 @@
+project(*Server): taoexe, portableserver, avoids_minimum_corba, iortable, avoids_corba_e_micro {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, anytypecode, avoids_minimum_corba {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger.idl b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger.idl
new file mode 100644
index 00000000000..2c75f1cb614
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger.idl
@@ -0,0 +1,3 @@
+interface Messenger {
+ boolean send_message (in string user_name, in string subject, inout string message);
+};
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerClient.cpp b/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerClient.cpp
new file mode 100644
index 00000000000..2fe9f2239fe
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerClient.cpp
@@ -0,0 +1,35 @@
+#include "MessengerC.h"
+#include <ace/SString.h>
+#include <iostream>
+
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) {
+ try {
+ if (argc <= 1) {
+ std::cerr << "Error: Must specify the name of an IOR file." << std::endl;
+ return 1;
+ }
+ ACE_CString ior = "file://";
+ ior += argv[1];
+
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str());
+
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Unable to get a Messenger reference." << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+ messenger->send_message("TAO User", "TAO Test", message.inout());
+ std::cout << "message was sent" << std::endl;
+ std::cout << "Reply was : " << message.in() << std::endl;
+
+ return 0;
+ } catch(const CORBA::Exception& ex) {
+ std::cerr << "Client main() Caught Exception: " << ex << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerServer.cpp b/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerServer.cpp
new file mode 100644
index 00000000000..893ce40442c
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/MessengerServer.cpp
@@ -0,0 +1,93 @@
+#include "Messenger_i.h"
+#include <tao/PortableServer/Root_POA.h>
+#include <tao/IORTable/IORTable.h>
+#include <iostream>
+#include <fstream>
+#include <fstream>
+
+PortableServer::POA_ptr
+createPersistentPOA(PortableServer::POA_ptr root_poa,
+ const char* poa_name) {
+
+ PortableServer::LifespanPolicy_var life =
+ root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
+
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy(PortableServer::USER_ID);
+
+ CORBA::PolicyList pols;
+ pols.length(2);
+ pols[0] = PortableServer::LifespanPolicy::_duplicate(life.in());
+ pols[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+ PortableServer::POA_var poa =
+ root_poa->create_POA(poa_name, mgr.in(), pols);
+
+ life->destroy();
+ assign->destroy();
+
+ return poa._retn();
+}
+
+void writeIORFile(const char* ior, const char* name) {
+ std::ofstream out(name);
+ out << ior;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+
+ const char* poa_name = "MessengerService";
+
+ PortableServer::POA_var poa = createPersistentPOA(root_poa.in(), poa_name);
+
+ Messenger_i servant1, servant2;
+
+ PortableServer::ObjectId_var id1 = PortableServer::string_to_ObjectId("Object1");
+ poa->activate_object_with_id(id1.in(), &servant1);
+ PortableServer::ObjectId_var id2 = PortableServer::string_to_ObjectId("Object2");
+ poa->activate_object_with_id(id2.in(), &servant2);
+
+ obj = poa->id_to_reference(id1.in());
+ CORBA::String_var ior1 = orb->object_to_string(obj.in());
+ obj = poa->id_to_reference(id2.in());
+ CORBA::String_var ior2 = orb->object_to_string(obj.in());
+
+ TAO_Root_POA* tpoa = dynamic_cast<TAO_Root_POA*>(poa.in());
+ obj = tpoa->id_to_reference_i(id1.in(), false);
+ CORBA::String_var direct_ior1 = orb->object_to_string(obj.in());
+
+ obj = orb->resolve_initial_references("IORTable");
+ IORTable::Table_var ior_table = IORTable::Table::_narrow(obj.in());
+ ior_table->bind("MessengerService/Object1", direct_ior1.in());
+ ior_table->bind("MessengerService/Object2", ior2.in());
+
+ writeIORFile(ior1.in(), "messenger1.ior");
+ writeIORFile(ior2.in(), "messenger2.ior");
+
+ mgr->activate();
+
+ std::cout << "Messenger server ready." << std::endl;
+
+ orb->run();
+
+ std::cout << "Messenger server shutting down." << std::endl;
+
+ root_poa->destroy(1,1);
+ orb->destroy();
+
+ return 0;
+ } catch(const CORBA::Exception& ex) {
+ std::cerr << "Server main() Caught Exception" << ex << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.cpp b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.cpp
new file mode 100644
index 00000000000..800d00fc5c0
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.cpp
@@ -0,0 +1,17 @@
+#include "Messenger_i.h"
+#include <iostream>
+
+
+CORBA::Boolean Messenger_i::send_message(
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException)
+{
+ std::cout << "Message from: " << user_name << std::endl
+ << "Subject: " << subject << std::endl
+ << "Message: " << message << std::endl;
+ message = CORBA::string_dup("A reply.");
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.h b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.h
new file mode 100644
index 00000000000..ec79e9d3d3c
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/Messenger_i.h
@@ -0,0 +1,17 @@
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/ImplRepo/IORTable/run_test.pl b/TAO/DevGuideExamples/ImplRepo/IORTable/run_test.pl
new file mode 100644
index 00000000000..6fa9bb20774
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/IORTable/run_test.pl
@@ -0,0 +1,129 @@
+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;
+
+my $WAIT_TIMEOUT = 2;
+my $DEBUG_LEVEL = 1;
+my $OBJ_REF_STYLE = "-orbobjrefstyle url";
+
+my $implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImplRepo_Service";
+my $imr_activator = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImR_Activator";
+my $tao_imr = "$ENV{ACE_ROOT}/bin/tao_imr";
+
+my $implrepo_ior = "imr.ior";
+my $activator_ior = "activator.ior";
+my $messenger1_ior = "messenger1.ior";
+my $messenger2_ior = "messenger2.ior";
+my $messenger3_ior = "messenger3.ior";
+my $messenger4_ior = "messenger4.ior";
+
+my $imr_init_ref = "-ORBInitRef ImplRepoService=file://$implrepo_ior";
+
+my $Svr = new PerlACE::Process('MessengerServer', "-orbuseimr 1 $OBJ_REF_STYLE $imr_init_ref");
+my $Cli = new PerlACE::Process('MessengerClient');
+
+sub CleanupOutput {
+ unlink $messenger1_ior;
+ unlink $messenger2_ior;
+ unlink $messenger3_ior;
+ unlink $messenger4_ior;
+ unlink $implrepo_ior;
+ unlink $activator_ior;
+}
+
+sub SpawnWait {
+ my $process = shift;
+ my $file = shift;
+
+ print ">>> " . $process->CommandLine() . "\n";
+ $process->Spawn();
+ my $ret = PerlACE::waitforfile_timed($file, $WAIT_TIMEOUT);
+ if ($ret == -1) {
+ print STDERR "ERROR: Cannot find file <$file>\n";
+ }
+ return $ret;
+}
+
+sub SpawnWaitKill {
+ my $process = shift;
+
+ print ">>> " . $process->CommandLine() . "\n";
+ return $process->SpawnWaitKill($WAIT_TIMEOUT);
+}
+
+# Use url object reference style for readability, and startup timeout of 2 seconds.
+# Unlike the chapter we'll forgo using -m, because we want to be able to run this
+# as a test in our nightly builds, and multicast could interfere with other machines.
+my $ImR = new PerlACE::Process ($implrepo_server, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -t 2 -o $implrepo_ior");
+my $Act = new PerlACE::Process ($imr_activator, "-d $DEBUG_LEVEL $OBJ_REF_STYLE -o $activator_ior $imr_init_ref");
+
+my $imr_util = new PerlACE::Process ("$tao_imr",
+ "$imr_init_ref add MessengerService -c \"$Svr->Executable() $OBJ_REF_STYLE -ORBUseIMR 1 $imr_init_ref\"");
+
+# We want the tao_imr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+$imr_util->IgnoreExeSubDir(1);
+
+sub RunImRUtil {
+ my $cmd = shift;
+ print ">>> " . $imr_util->CommandLine() . "\n";
+ $imr_util->Arguments("$imr_init_ref $cmd");
+ return $imr_util->SpawnWaitKill(5);
+}
+
+CleanupOutput();
+
+#### Start the example
+
+if (SpawnWait($ImR, $implrepo_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+if (SpawnWait($Svr, $messenger2_ior) != 0) {
+ $ImR->Kill();
+ exit 1;
+}
+
+$Cli->Arguments($messenger1_ior);
+if (SpawnWaitKill($Cli, $WAIT_TIMEOUT) != 0) {
+ print STDERR "Error : Client 1 failed to run correctly.";
+}
+
+$Cli->Arguments($messenger2_ior);
+if (SpawnWaitKill($Cli, $WAIT_TIMEOUT) != 0) {
+ print STDERR "Error : Client 2 failed to run correctly.";
+}
+
+#Since we didn't start the ImR with a known endpoint, we'll
+#have to use the tao_imr utility to create a our urls.
+RunImRUtil("ior MessengerService/Object1 -f $messenger3_ior");
+RunImRUtil("ior MessengerService/Object2 -f $messenger4_ior");
+
+$Cli->Arguments($messenger3_ior);
+if (SpawnWaitKill($Cli, $WAIT_TIMEOUT) != 0) {
+ print STDERR "Error : Client 3 failed to run correctly.";
+}
+
+# Notice that this one results in two calls through the ImR, because
+# we bound an indirect reference in the IORTable. If we were using
+# PER_CLIENT activation, this would be bad.
+$Cli->Arguments($messenger4_ior);
+if (SpawnWaitKill($Cli, $WAIT_TIMEOUT) != 0) {
+ print STDERR "Error : Client 4 failed to run correctly.";
+}
+
+$Svr->Kill();
+$ImR->Kill();
+
+
+#### Clean up any output files
+
+CleanupOutput();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/ImplRepo/ImplRepo.mpc b/TAO/DevGuideExamples/ImplRepo/ImplRepo.mpc
new file mode 100644
index 00000000000..67e78b8f0c2
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/ImplRepo.mpc
@@ -0,0 +1,13 @@
+project(*Server): taoexe, portableserver, iortable, avoids_minimum_corba, avoids_corba_e_micro {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, anytypecode, avoids_minimum_corba {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/Messenger.idl b/TAO/DevGuideExamples/ImplRepo/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/ImplRepo/MessengerClient.cpp b/TAO/DevGuideExamples/ImplRepo/MessengerClient.cpp
new file mode 100644
index 00000000000..4791f8f3c7c
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/MessengerClient.cpp
@@ -0,0 +1,36 @@
+
+#include "MessengerC.h"
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Destringify ior
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ std::cout << "message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Client main() Caught CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/MessengerServer.cpp b/TAO/DevGuideExamples/ImplRepo/MessengerServer.cpp
new file mode 100644
index 00000000000..6699a412342
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/MessengerServer.cpp
@@ -0,0 +1,101 @@
+// MessengerServer.cpp
+// This version uses the Implementation Repository.
+
+#include "Messenger_i.h"
+#include <tao/IORTable/IORTable.h>
+#include <tao/PortableServer/Root_POA.h>
+#include <iostream>
+
+PortableServer::POA_ptr
+createPOA(PortableServer::POA_ptr root_poa, const char* poa_name)
+{
+ PortableServer::LifespanPolicy_var life =
+ root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
+
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy(PortableServer::USER_ID);
+
+ CORBA::PolicyList pols;
+ pols.length(2);
+ pols[0] = PortableServer::LifespanPolicy::_duplicate(life.in());
+ pols[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+ PortableServer::POA_var poa =
+ root_poa->create_POA(poa_name, mgr.in(), pols);
+
+ life->destroy();
+ assign->destroy();
+
+ return poa._retn();
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+
+ const char* poa_name = "MessengerService";
+
+ PortableServer::POA_var messenger_poa = createPOA(root_poa.in(), poa_name);
+
+ Messenger_i messenger_servant;
+
+ PortableServer::ObjectId_var object_id =
+ PortableServer::string_to_ObjectId("messenger_object");
+
+ //
+ // Activate the servant with the messenger POA,
+ // obtain its object reference, and get a
+ // stringified IOR.
+ //
+ messenger_poa->activate_object_with_id(object_id.in(), &messenger_servant);
+
+ //
+ // Create binding between "MessengerService" and
+ // the messenger object reference in the IOR Table.
+ // Use a TAO extension to get the non imrified poa
+ // to avoid forwarding requests back to the ImR.
+
+ TAO_Root_POA* tpoa = dynamic_cast<TAO_Root_POA*>(messenger_poa.in());
+ obj = tpoa->id_to_reference_i(object_id.in(), false);
+ CORBA::String_var messenger_ior = orb->object_to_string(obj.in());
+ obj = orb->resolve_initial_references("IORTable");
+ IORTable::Table_var table = IORTable::Table::_narrow(obj.in());
+ table->bind(poa_name, messenger_ior.in());
+
+ //
+ // This server is now ready to run.
+ // This version does not create an IOR
+ // file as demonstrated in the
+ // Developer's Guide. It assumes that
+ // users create IORs for the client using
+ // the tao_imr utility.
+ //
+ //
+ // Stop discarding requests.
+ //
+ mgr->activate();
+
+ std::cout << "Messenger server ready." << std::endl;
+
+ orb->run();
+
+ std::cout << "Messenger server shutting down." << std::endl;
+
+ root_poa->destroy(1,1);
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Server main() Caught CORBA::Exception" << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ImplRepo/Messenger_i.cpp b/TAO/DevGuideExamples/ImplRepo/Messenger_i.cpp
new file mode 100644
index 00000000000..de1edefd4fa
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Messenger_i.cpp
@@ -0,0 +1,32 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ std::cout << "Message from: " << user_name << std::endl
+ << "Subject: " << subject << std::endl
+ << "Message: " << message << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/ImplRepo/Messenger_i.h b/TAO/DevGuideExamples/ImplRepo/Messenger_i.h
new file mode 100644
index 00000000000..e386c4c71da
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/ImplRepo/README b/TAO/DevGuideExamples/ImplRepo/README
new file mode 100644
index 00000000000..d255104cc4c
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/README
@@ -0,0 +1,28 @@
+
+DevGuideExamples/ImplRepo/README
+
+This directory contains a CORBA example illustrating use of the TAO
+Implementation Repository with a simple server (MessengerServer) and
+a client (MessengerClient).
+
+How to Run
+----------
+
+Start the Implementation Repository (ImplRepo) server:
+------------------------------------------------------
+$TAO_ROOT/orbsvcs/ImplRepo_Service/ImplRepo_Service -o implrepo.ior
+
+Register the server's POA name and start-up command with the ImplRepo:
+----------------------------------------------------------------------
+$TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr -ORBInitRef \
+ ImplRepoService=file://implrepo.ior add MessengerService \
+ -c "MessengerServer -ORBUseIMR 1 -ORBInitRef ImplRepoService=file://implrepo.ior"
+
+Generate an IMRified Object Reference for the MessengerService:
+---------------------------------------------------------------
+$TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr -ORBInitRef \
+ ImplRepoService=file://implrepo.ior ior MessengerService -f Messenger.ior
+
+Run the client (ImplRepo should automatically start the server):
+----------------------------------------------------------------
+./MessengerClient
diff --git a/TAO/DevGuideExamples/ImplRepo/run_test.pl b/TAO/DevGuideExamples/ImplRepo/run_test.pl
new file mode 100644
index 00000000000..e97deca65b0
--- /dev/null
+++ b/TAO/DevGuideExamples/ImplRepo/run_test.pl
@@ -0,0 +1,108 @@
+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;
+
+$implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImplRepo_Service";
+$imr_activator = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/ImR_Activator";
+$tao_imr = "$ENV{ACE_ROOT}/bin/tao_imr";
+
+# Note : We don't actually use SVR, but we need a way to get the
+# path to the -ExeSubDir
+my $SVR = new PerlACE::Process ('MessengerServer');
+my $server = $SVR->Executable ();
+
+# The Tests
+$implrepo_ior = "implrepo.ior";
+$activator_ior = "activator.ior";
+$messenger_ior = "Messenger.ior";
+
+# Make sure the files are gone, so we can wait on them.
+unlink $messenger_ior;
+unlink $implrepo_ior;
+unlink $activator_ior;
+
+$IR = new PerlACE::Process ($implrepo_server, "-d 1 -orbobjrefstyle url -t 5 -o $implrepo_ior");
+print ">>> " . $IR->CommandLine() . "\n";
+$IR->Spawn();
+if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$implrepo_ior>\n";
+ $IR->Kill();
+ exit 1;
+}
+
+$imr_init_ref = "-ORBInitRef ImplRepoService=file://$implrepo_ior";
+
+$ACT = new PerlACE::Process ($imr_activator, "-d 1 -orbobjrefstyle url -o $activator_ior $imr_init_ref");
+print ">>> " . $ACT->CommandLine() . "\n";
+$ACT->Spawn();
+if (PerlACE::waitforfile_timed ($activator_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$activator_ior>\n";
+ $IR->Kill();
+ $ACT->Kill();
+ exit 1;
+}
+
+
+$add_imr = new PerlACE::Process ("$tao_imr",
+ "$imr_init_ref add MessengerService -c \"$server -orbobjrefstyle url -ORBUseIMR 1 $imr_init_ref\"");
+print ">>> " . $add_imr->CommandLine() . "\n";
+# We want the tao_imr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+
+$add_imr->IgnoreExeSubDir (1);
+
+## Note : Instead of using tao_imr to generate the ior, it's easy enough
+## to just create one by hand. The ior is just a normal corbaloc ior with
+## the poa_name of the server and ip address of the imr.
+## (ie corbaloc::localhost:8888/Messengerservice)
+## Of course, to do this, you'd have to start the imr on port 8888.
+## We use the "tao_imr ior" command, because we don't know which port was used.
+$add_imr->SpawnWaitKill(10);
+$set_ior = new PerlACE::Process ("$tao_imr",
+ "$imr_init_ref ior MessengerService -f $messenger_ior");
+print ">>> " . $set_ior->CommandLine() . "\n";
+$set_ior->IgnoreExeSubDir (1);
+$set_ior->SpawnWaitKill(10);
+if (PerlACE::waitforfile_timed ($messenger_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$messenger_ior>\n";
+ $IR->Kill();
+ $ACT->Kill();
+ exit 1;
+}
+
+$C1 = new PerlACE::Process("MessengerClient");
+print ">>> " . $C1->CommandLine() . "\n";
+if ($C1->SpawnWaitKill(10) != 0) {
+ print "client 1 timed failed\n";
+ $IR->Kill ();
+ $ACT->Kill();
+ exit 1;
+}
+
+$shutdown = new PerlACE::Process ("$tao_imr",
+ "$imr_init_ref shutdown MessengerService");
+$shutdown->IgnoreExeSubDir (1);
+$shutdown->SpawnWaitKill(5);
+
+$C2 = new PerlACE::Process("MessengerClient");
+if ($C2->SpawnWaitKill(5) != 0) {
+ $IR->Kill ();
+ $ACT->Kill();
+ exit 1;
+}
+
+$shutdown->SpawnWaitKill(5);
+
+$IR->Kill();
+$ACT->Kill();
+
+unlink $messenger_ior;
+unlink $implrepo_ior;
+unlink $activator_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/InterfaceRepo/IFRBrowser.cpp b/TAO/DevGuideExamples/InterfaceRepo/IFRBrowser.cpp
new file mode 100644
index 00000000000..f70f029d769
--- /dev/null
+++ b/TAO/DevGuideExamples/InterfaceRepo/IFRBrowser.cpp
@@ -0,0 +1,277 @@
+//
+// IFRBrowser.cpp
+//
+// A rudimentary interface repository
+// browser, very rudimentary
+//
+
+#include <tao/IFR_Client/IFR_BasicC.h>
+#include <tao/ORB.h>
+#include <ace/Log_Msg.h>
+
+#include <iostream>
+
+const char* programLabel = "IFR Browser";
+
+void listContents(const CORBA::ContainedSeq &repoContents);
+void listInterface(CORBA::InterfaceDef_ptr interfaceDef);
+void listOperation(CORBA::OperationDescription* operationDescr);
+void listParameter(CORBA::ParameterDescription* parameterDescr);
+
+const char* decodeTypeCode(const CORBA::TypeCode_ptr typeCode);
+const char* decodeParameterMode(CORBA::ParameterMode mode);
+const char* decodeOperationMode(CORBA::OperationMode mode);
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj =
+ orb->resolve_initial_references("InterfaceRepository");
+
+ CORBA::Repository_var ifrRepo = CORBA::Repository::_narrow(obj.in());
+
+ if (CORBA::is_nil(ifrRepo.in()))
+ {
+ ACE_DEBUG((LM_ERROR,
+ ACE_TEXT("(%N) failed to narrow interface repository referece.\n")
+ ));
+ return -1;
+ }
+
+ CORBA::ContainedSeq_var repoContents = ifrRepo->contents(CORBA::dk_all, 1);
+
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: the interface repository contains %d elements.\n"),
+ programLabel,
+ repoContents->length()
+ ));
+ listContents(repoContents.in());
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "main() Caught CORBA::Exception : " << ex << std::endl;
+ }
+ return 1;
+}
+
+void listContents(const CORBA::ContainedSeq& repoContents)
+{
+ //
+ // List the contents of each element.
+ //
+ for(unsigned int i = 0; i < repoContents.length(); ++i)
+ {
+ CORBA::Contained::Description_var desc = repoContents[i]->describe();
+ switch(desc->kind)
+ {
+ case CORBA::dk_Constant:
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: element[%d] is a constant definition.\n"),
+ programLabel,
+ i + 1
+ ));
+ break;
+ case CORBA::dk_Typedef:
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: element[%d] is a typedef definition.\n"),
+ programLabel,
+ i + 1
+ ));
+ break;
+ case CORBA::dk_Exception:
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: element[%d] is an exception definition.\n"),
+ programLabel,
+ i + 1
+ ));
+ break;
+ case CORBA::dk_Interface:
+ {
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: element[%d] is an interface definition.\n")
+ ACE_TEXT("%s: listing element[%d]...\n"),
+ programLabel,
+ i + 1,
+ programLabel,
+ i + 1
+ ));
+ CORBA::InterfaceDef_var interfaceDef =
+ CORBA::InterfaceDef::_narrow(repoContents[i]);
+ listInterface(interfaceDef.in());
+ break;
+ }
+ case CORBA::dk_Module: {
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: element[%d] is a module definition.\n"),
+ programLabel,
+ i + 1
+ ));
+ CORBA::ModuleDef_var moduleDef =
+ CORBA::ModuleDef::_narrow(repoContents[i]);
+ CORBA::ContainedSeq_var moduleContents =
+ moduleDef->contents(CORBA::dk_all,1);
+ CORBA::String_var moduleId = moduleDef->id();
+ CORBA::String_var moduleName = moduleDef->name();
+
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s:\n// %s\nmodule %s\n{\n")
+ ACE_TEXT("%s: the module contains %d elements.\n"),
+ programLabel,
+ moduleId.in(),
+ moduleName.in(),
+ programLabel,
+ moduleContents->length()
+ ));
+ listContents(moduleContents.in());
+ ACE_DEBUG((LM_INFO, ACE_TEXT("}\n")));
+ break;
+ }
+ default:
+ break;
+ }
+ }
+}
+
+void listInterface(CORBA::InterfaceDef_ptr interfaceDef)
+{
+ CORBA::InterfaceDef::FullInterfaceDescription_var fullDescr =
+ interfaceDef->describe_interface();
+
+ const char* interfaceName =
+ fullDescr->name;
+ const char* interfaceRepoId =
+ fullDescr->id;
+
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s:\n\t// %s\n\tinterface %s\n\t{"),
+ programLabel,
+ interfaceRepoId,
+ interfaceName
+ ));
+
+
+ unsigned int operationsCount;
+ if ((operationsCount = fullDescr->operations.length()) > 0)
+ {
+ for(unsigned int i = 0; i < operationsCount; ++i)
+ {
+ listOperation(&(fullDescr->operations[i]));
+ }
+ }
+
+ unsigned int attributesCount;
+ if ((attributesCount = fullDescr->attributes.length()) > 0)
+ {
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s: %s has %d attribute(s).\n"),
+ programLabel,
+ interfaceName,
+ attributesCount
+ ));
+ }
+
+ ACE_DEBUG((LM_INFO, "\n\t}\n"));
+}
+
+void listOperation(CORBA::OperationDescription* operationDescr)
+{
+ const char* operationName =
+ operationDescr->name;
+ const char* operationRepoId =
+ operationDescr->id;
+ const char* operationResult =
+ decodeTypeCode(operationDescr->result.in());
+ const char* operationMode =
+ decodeOperationMode(operationDescr->mode);
+
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("\n\t\t// %s \n\t\t%s %s %s"),
+ operationRepoId,
+ operationResult,
+ operationName,
+ operationMode
+ ));
+
+ CORBA::ParDescriptionSeq* params = &(operationDescr->parameters);
+ CORBA::ULong paramsCount = params->length();
+ if (paramsCount > 0)
+ {
+ ACE_DEBUG((LM_INFO, "\n\t\t(\n\t\t"));
+ for(CORBA::ULong i =0; i < paramsCount; ++i)
+ {
+ listParameter(&((*params)[i]));
+ if(i < (paramsCount - 1))
+ {
+ ACE_DEBUG((LM_INFO, ",\n\t\t"));
+ }
+ }
+ ACE_DEBUG((LM_INFO, "\n\t\t);\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_INFO, "();\n"));
+ }
+}
+
+void listParameter(CORBA::ParameterDescription *parameterDescr)
+{
+ const char *typCode =
+ decodeTypeCode(parameterDescr->type.in());
+ const char *paramMode =
+ decodeParameterMode(parameterDescr->mode);
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("%s %s %s"),
+ paramMode,
+ typCode,
+ parameterDescr->name.in()
+ ));
+}
+
+const char* decodeTypeCode(const CORBA::TypeCode_ptr typeCode)
+{
+ const char* code = "";
+ if (typeCode->equivalent(CORBA::_tc_void)) {
+ code = "void";
+ } else if (typeCode->equivalent(CORBA::_tc_boolean)) {
+ code = "boolean";
+ } else if (typeCode->equivalent(CORBA::_tc_string)) {
+ code = "string";
+ }
+ return code;
+}
+
+const char* decodeParameterMode(CORBA::ParameterMode mode)
+{
+ const char* paramMode;
+ switch(mode)
+ {
+ case CORBA::PARAM_IN:
+ {
+ paramMode = "in";
+ break;
+ }
+ case CORBA::PARAM_OUT:
+ {
+ paramMode = "out";
+ break;
+ }
+ case CORBA::PARAM_INOUT:
+ {
+ paramMode = "inout";
+ break;
+ }
+ default:
+ paramMode = "";
+ }
+ return paramMode;
+}
+
+const char* decodeOperationMode(CORBA::OperationMode mode)
+{
+ return (mode == CORBA::OP_NORMAL) ? "synchronous" : "asynchronous";
+}
diff --git a/TAO/DevGuideExamples/InterfaceRepo/InterfaceRepo.mpc b/TAO/DevGuideExamples/InterfaceRepo/InterfaceRepo.mpc
new file mode 100644
index 00000000000..af4711a25c4
--- /dev/null
+++ b/TAO/DevGuideExamples/InterfaceRepo/InterfaceRepo.mpc
@@ -0,0 +1,3 @@
+project(*Browser): taoexe, portableserver, ifr_client {
+ exename = IFRBrowser
+}
diff --git a/TAO/DevGuideExamples/InterfaceRepo/run_test.pl b/TAO/DevGuideExamples/InterfaceRepo/run_test.pl
new file mode 100644
index 00000000000..ed9447f8f79
--- /dev/null
+++ b/TAO/DevGuideExamples/InterfaceRepo/run_test.pl
@@ -0,0 +1,84 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+use Env (ACE_ROOT);
+use Env (TAO_ROOT);
+use lib "$ACE_ROOT/bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$ifr_iorfile= "if_repo.ior";
+
+$ifr_server = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/IFR_Service";
+$tao_ifr = "$ENV{ACE_ROOT}/bin/tao_ifr";
+$test_idl = "test.idl";
+
+$lookup_by_name = "";
+$other = "";
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-n") {
+ $lookup_by_name = "-n";
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+$TAO_IFR = new PerlACE::Process ($tao_ifr);
+$IFR = new PerlACE::Process ($ifr_server);
+$CL = new PerlACE::Process ("IFRBrowser", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile $lookup_by_name");
+
+# We want the tao_ifr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+
+$TAO_IFR->IgnoreExeSubDir (1);
+
+unlink $ifr_iorfile;
+
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifr_iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
+
+$TAO_IFR->Arguments ("-ORBInitRef InterfaceRepository=file://$ifr_iorfile $test_idl");
+
+$tresult = $TAO_IFR->SpawnWaitKill (30);
+
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (test.idl) returned $tresult\n";
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (5);
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+# remove the interface from the Interface Repository.
+$TAO_IFR->Arguments ("-ORBInitRef InterfaceRepository=file://$ifr_iorfile -r $test_idl");
+
+$tresult = $TAO_IFR->SpawnWaitKill (30);
+
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (-r test.idl) returned $tresult\n";
+ $status = 1;
+}
+
+$server = $IFR->TerminateWaitKill (5);
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
+
+unlink $ifr_iorfile;
+
+exit $status;
+
diff --git a/TAO/DevGuideExamples/InterfaceRepo/test.idl b/TAO/DevGuideExamples/InterfaceRepo/test.idl
new file mode 100644
index 00000000000..8ac11a758fb
--- /dev/null
+++ b/TAO/DevGuideExamples/InterfaceRepo/test.idl
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+// $Id$
+
+module warehouse
+{
+ interface inventory
+ {
+ boolean getCDinfo (in string artist,
+ inout string title,
+ out float price);
+ };
+};
+
+
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.idl b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.idl
new file mode 100644
index 00000000000..b2936ef6131
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.idl
@@ -0,0 +1,9 @@
+// Messenger.idl
+
+local interface Messenger
+{
+ boolean send_message (in string user_name,
+ in string subject,
+ inout string message);
+};
+
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.mpc b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.mpc
new file mode 100644
index 00000000000..6105ab2e210
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger.mpc
@@ -0,0 +1,2 @@
+project(LocalObject*Server): taoexe, portableserver {
+}
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/LocalObjects/Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..3446a3bf42b
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/MessengerServer.cpp
@@ -0,0 +1,27 @@
+
+#include "Messenger_i.h"
+#include <iostream>
+int main (int, char **)
+{
+ try {
+ // Construct a Messenger object and use it "as if" it's a corba object.
+ // Put it into CORBA object reference
+ // comparable to activation, narrow, etc.
+ Messenger_var messenger(new Messenger_i);
+
+ // Send a message the the Messenger object.
+ CORBA::String_var message = CORBA::string_dup ("Hello!");
+ messenger->send_message("TAO User", "TAO Test", message.inout());
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << message.in() << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught CORBA::Exception : " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..7e56f932f05
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.cpp
@@ -0,0 +1,29 @@
+#include "Messenger_i.h"
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::string_free(message);
+ message = CORBA::string_dup("Thanks for the message.");
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.h b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.h
new file mode 100644
index 00000000000..22e63abdc41
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/Messenger_i.h
@@ -0,0 +1,32 @@
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+#include <tao/LocalObject.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual Messenger,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl b/TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl
new file mode 100644
index 00000000000..20a2ff037d3
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl
@@ -0,0 +1,15 @@
+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;
+
+$S = new PerlACE::Process("MessengerServer");
+$S->SpawnWaitKill(10);
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger.idl b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger.idl
new file mode 100644
index 00000000000..9998b3eadb3
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger.idl
@@ -0,0 +1,9 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message (in string user_name,
+ in string subject,
+ inout string message);
+};
+
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerClient.cpp b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerClient.cpp
new file mode 100644
index 00000000000..7ff64b41629
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerClient.cpp
@@ -0,0 +1,37 @@
+#include "MessengerC.h"
+#include <iostream>
+
+int main (int argc, char *argv [])
+{
+ try {
+ // Initialize the ORB
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ // Converts the contents of the file to an object reference
+ CORBA::Object_var obj = orb->string_to_object ("file://Messenger.ior");
+ if (CORBA::is_nil (obj.in())) {
+ std::cerr << "Nill Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow the object reference to a Messenger object reference
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil (messenger.in())) {
+ std::cerr << "Not a Messenger object reference" << std::endl;
+ return 1;
+ }
+
+ // Create a message and send it to the Messenger
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+ messenger->send_message ("TAO User", "TAO Test", message.inout());
+
+ orb->destroy();
+ std::cout << "Message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Client Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+ std::cout << "Message was sent" << std::endl;
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.cpp b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.cpp
new file mode 100644
index 00000000000..9628e3ac26f
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "MessengerLocator_i.h"
+#include "Messenger_i.h"
+
+#include <ace/SString.h>
+#include <iostream>
+
+Messenger_Locator_i::Messenger_Locator_i()
+{
+}
+
+PortableServer::Servant
+Messenger_Locator_i::preinvoke (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr,
+ const char *,
+ void * & cookie )
+ throw (CORBA::SystemException, PortableServer::ForwardRequest)
+{
+ // Get the ObjectId in string format.
+ CORBA::String_var oid_str = PortableServer::ObjectId_to_string (oid);
+
+ std::cout << "preinvoke called..." << oid_str << std::endl;
+
+ // Check if the ObjectId is valid.
+ ACE_CString cstr(oid_str.in());
+ if (cstr == "Messenger") {
+ // Create the required servant
+ PortableServer::ServantBase_var servant = new Messenger_i ();
+
+ // Set a flag so that we know to delete it in postinvoke().
+ cookie = (void *)1;
+
+ return servant._retn();
+ }
+ else {
+ throw CORBA::OBJECT_NOT_EXIST ();
+ }
+}
+
+void
+Messenger_Locator_i::postinvoke (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr,
+ const char *,
+ void * cookie,
+ PortableServer::Servant servant)
+ throw (CORBA::SystemException)
+{
+
+ std::cout << "postinvoke called..." << std::endl;
+
+ // Delete the servant as it is no longer needed.
+ if (cookie != 0) {
+ delete servant;
+ }
+}
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.h b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.h
new file mode 100644
index 00000000000..f969ecffa78
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerLocator_i.h
@@ -0,0 +1,31 @@
+#ifndef MESSENGER_LOCATOR_I_H
+#define MESSENGER_LOCATOR_I_H
+
+#include "tao/corba.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantLocatorC.h"
+
+class Messenger_Locator_i : public PortableServer::ServantLocator,
+ public CORBA::LocalObject
+{
+ public:
+ Messenger_Locator_i();
+
+ // Preinvoke function
+ virtual PortableServer::Servant preinvoke (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa,
+ const char * operation,
+ void * & cookie)
+ throw (CORBA::SystemException, PortableServer::ForwardRequest);
+
+ // Postinvoke function
+ virtual void postinvoke (const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr poa,
+ const char * operation,
+ void * cookie,
+ PortableServer::Servant servant)
+ throw (CORBA::SystemException);
+
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerServer.cpp b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerServer.cpp
new file mode 100644
index 00000000000..956f6632183
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/MessengerServer.cpp
@@ -0,0 +1,76 @@
+
+#include "MessengerLocator_i.h"
+#include "MessengerC.h"
+
+#include <tao/AnyTypeCode/TypeCode.h>
+#include <iostream>
+#include <fstream>
+int main (int argc, char * argv[])
+{
+ try {
+ // Initialize the ORB
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Get a reference to the POA
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (obj.in());
+
+ // Active the POA Manager
+ PortableServer::POAManager_var mgr = rootPOA->the_POAManager();
+ mgr->activate();
+
+ // Create the policies and assign them for the child POA
+ CORBA::PolicyList policies(3);
+ policies.length(3);
+
+ policies[0] = rootPOA->create_id_assignment_policy(PortableServer::USER_ID);
+ policies[1] = rootPOA->create_request_processing_policy(PortableServer::USE_SERVANT_MANAGER);
+ policies[2] = rootPOA->create_servant_retention_policy(PortableServer::NON_RETAIN);
+
+ // Create the POA with these policies
+ PortableServer::POA_var childPOA = rootPOA->create_POA("childPOA", mgr.in(), policies);
+
+ // Destroy the policy objects
+ for (CORBA::ULong i = 0; i != policies.length(); ++i) {
+ policies[i]->destroy();
+ }
+
+ // Create our Messenger's ServantLocator.
+ PortableServer::ServantLocator_var locator = new Messenger_Locator_i;
+
+ // Set the Servant Manager with the childPOA.
+ childPOA->set_servant_manager(locator.in());
+
+ // Get the object id for the user-created ID in the childPOA.
+ PortableServer::ObjectId_var child_oid = PortableServer::string_to_ObjectId("Messenger");
+
+ // Create the object without creating a servant.
+ CORBA::Object_var messenger_obj =
+ childPOA->create_reference_with_id(child_oid.in(), ::_tc_Messenger->id());
+
+ // Put the object reference into an IOR string
+ CORBA::String_var str = orb->object_to_string(messenger_obj.in());
+
+ // Write the IOR string to a file
+ std::ofstream iorFile("Messenger.ior"); // Throws exception if there's a problem.
+ iorFile << str.in();
+ iorFile.close();
+
+ std::cout << "IOR written to the file Messenger.ior." << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+
+ // Release resources
+ rootPOA->destroy(1,1);
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Server Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.cpp b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.cpp
new file mode 100644
index 00000000000..dce1646bb24
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.cpp
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean
+Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ return true;
+}
+
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.h b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.h
new file mode 100644
index 00000000000..9af2c134dc2
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/Messenger_i.h
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/ServantLocator.mpc b/TAO/DevGuideExamples/LocalObjects/ServantLocator/ServantLocator.mpc
new file mode 100644
index 00000000000..821064369cd
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/ServantLocator.mpc
@@ -0,0 +1,14 @@
+project(*Server): taoexe, portableserver, anytypecode, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ MessengerLocator_i.cpp
+ }
+}
+
+project(*Client): taoexe, anytypecode, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/LocalObjects/ServantLocator/run_test.pl b/TAO/DevGuideExamples/LocalObjects/ServantLocator/run_test.pl
new file mode 100644
index 00000000000..cc79c4e93a8
--- /dev/null
+++ b/TAO/DevGuideExamples/LocalObjects/ServantLocator/run_test.pl
@@ -0,0 +1,35 @@
+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;
+
+$messenger_ior = "Messenger.ior";
+
+unlink $messenger_ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($messenger_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$implrepo_ior>\n";
+ $S->Kill();
+ exit 1;
+}
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $S->Kill();
+ exit 1;
+}
+
+$S->Kill();
+
+unlink $messenger_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/AMIcallback.mpc b/TAO/DevGuideExamples/Messaging/AMIcallback/AMIcallback.mpc
new file mode 100644
index 00000000000..cb49b4153aa
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/AMIcallback.mpc
@@ -0,0 +1,26 @@
+project(*Server): messaging, taoexe, portableserver, ami {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): messaging, taoexe, portableserver, ami {
+ Source_Files {
+ MessengerHandler.cpp
+ MessengerClient.cpp
+ }
+ verbatim(gnuace, local) {
+ ## Using the -g option causes an internal compiler error with g++ 2.96
+ ## on Linux Itanium when compiling MessengerHandler.cpp.
+ ifeq ($(CXX), g++)
+ ifeq ($(findstring 2.96, $(CXX_VERSION)), 2.96)
+ ifeq ($(shell uname -s), Linux)
+ ifeq ($(shell uname -m), ia64)
+ DCFLAGS = -O0
+ endif
+ endif
+ endif
+ endif
+ }
+}
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger.idl b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger.idl
new file mode 100644
index 00000000000..ad65ac16b8d
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger.idl
@@ -0,0 +1,15 @@
+// Messenger.idl
+
+exception MessengerUnableToSendMessage
+{
+};
+
+interface Messenger
+{
+
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message,
+ out long time_sent)
+ raises (MessengerUnableToSendMessage);
+};
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerClient.cpp b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerClient.cpp
new file mode 100644
index 00000000000..7aa13bd568b
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerClient.cpp
@@ -0,0 +1,98 @@
+#include "MessengerC.h"
+#include "MessengerHandler.h"
+
+#include <ace/OS_NS_stdio.h>
+#include <ace/OS_NS_unistd.h>
+#include <ace/OS_NS_sys_time.h>
+#include <iostream>
+
+//-----------------------------------------------------------------------------
+
+int
+main(int argc, char * argv[])
+{
+ try {
+
+ // assume any command line parameter means we want an automated test.
+ bool automated = argc > 1;
+
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object("file://MessengerServer.ior");
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Get reference to Root POA.
+ 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();
+
+ // Register an AMI handler for the Messenger interface
+ MessengerHandler servant(orb.in());
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ AMI_MessengerHandler_var handler = AMI_MessengerHandler::_narrow(obj.in());
+
+ CORBA::String_var user = CORBA::string_alloc(81);
+ CORBA::String_var subject = CORBA::string_alloc(81);
+ CORBA::String_var message = CORBA::string_alloc(81);
+
+ if (! automated) {
+ std::cout << "Enter user name -->";
+ std::cin.getline(user, 81);
+
+ std::cout << "Enter subject -->";
+ std::cin.getline(subject, 81);
+
+ std::cout << "Enter message -->";
+ std::cin.getline(message, 81);
+ } else {
+ user = CORBA::string_dup("TestUser");
+ subject = CORBA::string_dup("TestSubject");
+ message = CORBA::string_dup("Have a nice day.");
+ }
+
+ // Record the time the request was made.
+ ACE_Time_Value time_sent = ACE_OS::gettimeofday();
+
+ messenger->sendc_send_message(handler.in(), user.in(), subject.in(), message.in());
+
+ // Do some work to prove that we can send the message asynchronously, do some work,
+ // then come back later and retrieve the results.
+ for (int i = 0; i < 10; ++i) {
+ ACE_OS::printf(".");
+ ACE_OS::sleep(ACE_Time_Value(0, 10 * 1000));
+ }
+
+ // Our simple servant will exit as soon as it receives the results.
+ orb->run();
+
+ if (servant.message_was_sent())
+ {
+ // Note : We can't use the
+ ACE_Time_Value delay = ACE_OS::gettimeofday() - time_sent;
+ std::cout << std::endl << "Reply Delay = " << delay.msec() << "ms" << std::endl;
+ }
+
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.cpp b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.cpp
new file mode 100644
index 00000000000..783f00801da
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.cpp
@@ -0,0 +1,58 @@
+#include "MessengerHandler.h"
+#include <ace/OS_NS_time.h>
+#include <iostream>
+
+// Implementation skeleton constructor
+MessengerHandler::MessengerHandler (CORBA::ORB_ptr orb)
+: time_(0)
+, orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+// Implementation skeleton destructor
+MessengerHandler::~MessengerHandler (void)
+{
+}
+
+void MessengerHandler::send_message (
+ CORBA::Boolean ami_return_val,
+ const char * message,
+ CORBA::Long time
+ )
+ throw (CORBA::SystemException)
+
+{
+ if (ami_return_val)
+ {
+ time_ = time;
+ time_t t = time_;
+ const ACE_TCHAR * time_str = ACE_OS::ctime(&t);
+ if (time_str != 0) {
+ std::cout << std::endl << "Message sent at " <<
+ ACE_TEXT_ALWAYS_CHAR (time_str) << std::endl;
+ }
+ std::cout << "Content of message: " << message << std::endl;
+ }
+ else
+ {
+ std::cerr << "Error: Message was not sent." << std::endl;
+ }
+ // Our simple test just shuts down after sending one message.
+ orb_->shutdown(0);
+}
+
+void MessengerHandler::send_message_excep (Messaging::ExceptionHolder* excep_holder)
+ throw (CORBA::SystemException)
+{
+ // We'll print an error message and shut down the orb
+ try
+ {
+ excep_holder->raise_exception();
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "A CORBA Exception was thrown: " << ex << std::endl;
+ }
+ orb_->shutdown(0);
+}
+
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.h b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.h
new file mode 100644
index 00000000000..62ac6198202
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerHandler.h
@@ -0,0 +1,38 @@
+#ifndef MESSENGERHANDLER_H
+#define MESSENGERHANDLER_H
+
+#include "MessengerS.h"
+
+class MessengerHandler : public virtual POA_AMI_MessengerHandler
+{
+public:
+ //Constructor
+ MessengerHandler (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~MessengerHandler (void);
+
+virtual void send_message (
+ CORBA::Boolean ami_return_val,
+ const char * message,
+ CORBA::Long time
+ )
+ throw(CORBA::SystemException);
+
+virtual void send_message_excep (
+ Messaging::ExceptionHolder * excep_holder
+ )
+ throw(CORBA::SystemException);
+
+
+ int message_was_sent()
+ {
+ return time_ > 0;
+ }
+
+private:
+ CORBA::Long time_;
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerServer.cpp b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerServer.cpp
new file mode 100644
index 00000000000..04d8e7ac7e9
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/MessengerServer.cpp
@@ -0,0 +1,65 @@
+#include "Messenger_i.h"
+#include <fstream>
+#include <iostream>
+#include <fstream>
+
+int
+main(int argc, char * argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Set a wait time to an integer if it has been passed as a
+ // command line argument. Otherwise, have
+ // Messenger_i::send_message() throw an exception if e
+ // has been passed as the command lin argument.
+ unsigned int seconds_to_wait = 0;
+ CORBA::Boolean servant_throws_exception = 0;
+ if (argc == 2)
+ {
+ if (argv[1][0] == 'e')
+ {
+ servant_throws_exception = 1;
+ std::cout << "Messenger_i::send_message() will throw an exception." << std::endl;
+ }
+ else
+ {
+ seconds_to_wait = atoi(argv[1]);
+ std::cout << "Messenger_i::send_message() will wait "
+ << seconds_to_wait << " seconds" << std::endl;
+ }
+ }
+
+ // 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();
+
+ // Create an object
+ Messenger_i servant(seconds_to_wait, servant_throws_exception);
+
+ // Write its stringified reference to stdout
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ CORBA::String_var str = orb->object_to_string(messenger.in());
+ std::ofstream fout("MessengerServer.ior");
+ fout << str.in() << std::endl;
+ fout.close();
+ std::cout << "IOR written to file MessengerServer.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.cpp b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.cpp
new file mode 100644
index 00000000000..e80cab4fb2e
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.cpp
@@ -0,0 +1,60 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/OS_NS_unistd.h>
+#include <ace/OS_NS_sys_time.h>
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (unsigned int seconds_to_wait,
+ CORBA::Boolean throw_exception)
+ : seconds_to_wait_(seconds_to_wait)
+ , throw_exception_(throw_exception)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message,
+ CORBA::Long_out time_sent
+ )
+ throw (CORBA::SystemException, MessengerUnableToSendMessage)
+{
+ if (throw_exception_)
+ {
+ std::cout << "Throwing MessengerUnableToSendMessage exception." << std::endl;
+ throw MessengerUnableToSendMessage();
+ }
+
+ std::cout << "Write a letter to " << user_name << " as follows:" << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Dear " << user_name << ',' << std::endl;
+ std::cout << message << std::endl;
+
+ if (seconds_to_wait_ > 0)
+ {
+ std::cout << "Waiting for " << seconds_to_wait_ << " seconds..." << std::flush;
+ ACE_OS::sleep(seconds_to_wait_);
+ std::cout << " Done waiting" << std::endl;
+ }
+
+ // Record the time the message was sent
+ time_sent = static_cast<CORBA::Long> (ACE_OS::gettimeofday().sec());
+
+ // We will assume the message has been sent, so return true
+ return 1;
+}
+
+
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.h b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.h
new file mode 100644
index 00000000000..61785d4edf2
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/Messenger_i.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_IMPL_H_
+#define MESSENGER_IMPL_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (unsigned int seconds_to_wait = 0,
+ CORBA::Boolean throw_exception = 0);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message,
+ CORBA::Long_out time_sent
+ )
+ throw (CORBA::SystemException, MessengerUnableToSendMessage);
+
+private:
+ // Specify an amount of time to wait inside
+ // send_message in order illustrate AMI callback usage
+ unsigned int seconds_to_wait_;
+
+ // Force an exception to be thrown to test client-side
+ // exception handling
+ CORBA::Boolean throw_exception_;
+
+};
+
+
+
+#endif /* MESSENGER_IMPL_H_ */
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/README b/TAO/DevGuideExamples/Messaging/AMIcallback/README
new file mode 100644
index 00000000000..71f32802adb
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/README
@@ -0,0 +1,39 @@
+CORBA Messaging
+
+
+File: DevGuideExamples/Messaging/AMIcallback/README
+
+
+This directory contains an example illustrating the Asynchronous
+Method Invocation (AMI) feature of TAO. This feature permits
+requests to be made that do not require a client to block while
+waiting for a reply from a server.
+
+This example is based on the Messenger example in GettingStarted
+directory. A message is send by MessengerClient and displayed by
+MessengerServer. The server responds to provide confirmation
+that the message was received. The delay for this exchange of
+messages is then displayed.
+
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/Messaging/AMIcallback/run_test.pl b/TAO/DevGuideExamples/Messaging/AMIcallback/run_test.pl
new file mode 100644
index 00000000000..29a8c0df380
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/AMIcallback/run_test.pl
@@ -0,0 +1,37 @@
+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;
+
+$ior="MessengerServer.ior";
+unlink $ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $ior\n";
+ $S->Kill();
+ exit 1;
+}
+
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", "-automated");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+unlink $ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger.idl b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerClient.cpp b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerClient.cpp
new file mode 100644
index 00000000000..cf9044566b1
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerClient.cpp
@@ -0,0 +1,74 @@
+#include "MessengerC.h"
+#include <tao/TimeBaseC.h>
+#include "tao/Messaging/Messaging.h"
+#include <iostream>
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object("file://MessengerServer.ior");
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ ACE_ASSERT(! CORBA::is_nil(messenger.in()));
+
+ obj = orb->resolve_initial_references("ORBPolicyManager");
+ CORBA::PolicyManager_var policy_manager = CORBA::PolicyManager::_narrow(obj.in());
+ ACE_ASSERT(! CORBA::is_nil(policy_manager.in()));
+ obj = orb->resolve_initial_references("PolicyCurrent");
+ CORBA::PolicyCurrent_var policy_current = CORBA::PolicyCurrent::_narrow (obj.in());
+ ACE_ASSERT(! CORBA::is_nil(policy_current.in()));
+
+ // Set the RelativeRoundtripTimeout value
+ long msecs = 0;
+ if (argc > 1) {
+ msecs = ACE_OS::atoi(argv[1]);
+ } else {
+ std::cout << "Enter relative roundtrip timeout in milliseconds -->";
+ std::cin >> msecs;
+ }
+ // TimeT is in 10ths of a microsecond (10000 == 1.0e-3 * 1.0e7).
+ TimeBase::TimeT relative_rt_timeout = msecs * 10000;
+
+ CORBA::Any relative_rt_timeout_as_any;
+ relative_rt_timeout_as_any <<= relative_rt_timeout;
+ CORBA::PolicyList policy_list(1);
+ policy_list.length(1);
+ policy_list[0] =
+ orb->create_policy(Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ relative_rt_timeout_as_any);
+
+ // We demonstrate setting the policy at each of three levels. In practice,
+ // you would only need to set the policy for one of these.
+ // Set timeouts for the whole orb.
+ policy_manager->set_policy_overrides(policy_list, CORBA::ADD_OVERRIDE);
+ // Set timeouts for the current thread.
+ policy_current->set_policy_overrides(policy_list, CORBA::ADD_OVERRIDE);
+ // Set timeouts for the messenger object.
+ obj = messenger->_set_policy_overrides(policy_list, CORBA::SET_OVERRIDE);
+ messenger = Messenger::_narrow(obj.in());
+ ACE_ASSERT(! CORBA::is_nil(messenger.in()));
+
+ policy_list[0]->destroy();
+ policy_list[0] = CORBA::Policy::_nil();
+
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+
+ try {
+ messenger->send_message ("TAO User", "TAO Test", message.inout());
+ std::cerr << "ERROR: Message did not timeout." << std::endl;
+ } catch(const CORBA::TIMEOUT&) {
+ std::cout << "Message Timed out as expected." << std::endl;
+ }
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerServer.cpp b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerServer.cpp
new file mode 100644
index 00000000000..77105c49492
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/MessengerServer.cpp
@@ -0,0 +1,41 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ // 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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Write its stringified reference to a file
+ PortableServer::ObjectId_var oid = poa->activate_object(&messenger_servant);
+ obj = poa->id_to_reference(oid.in());
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ CORBA::String_var str = orb->object_to_string(messenger.in());
+ std::ofstream fout("MessengerServer.ior");
+ fout << str.in() << std::endl;
+ fout.close();
+ std::cout << "IOR written to file MessengerServer.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA::Exception " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.cpp b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.cpp
new file mode 100644
index 00000000000..72d8c63d04a
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.cpp
@@ -0,0 +1,38 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/OS_NS_unistd.h>
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ // Force a delay in the reply in order to test the Relative Roundtrip Timeout Policy
+ ACE_OS::sleep(ACE_Time_Value(0, 100 * 1000));
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+ return true;
+}
+
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.h b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.h
new file mode 100644
index 00000000000..af12e09474a
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/README b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/README
new file mode 100644
index 00000000000..b5f4c440ade
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/README
@@ -0,0 +1,40 @@
+CORBA Messaging
+
+
+File: DevGuideExamples/Messaging/RelativeRoundtripTimeout/README
+
+
+This directory contains an example illustrating the relative
+round trip timeout policy defined in CORBA Messaging.
+
+At each request invocation on the server, the client checks
+against a user-specified timout value. If the time spent since
+the start of the request exceeds the timeout value, a CORBA::TIMEOUT
+exception is raised.
+
+This example is based on the Messenger example in GettingStarted
+directory.
+
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc
new file mode 100644
index 00000000000..5d04c506cb0
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/RelativeRoundtripTimeout.mpc
@@ -0,0 +1,13 @@
+project(*Server): taoexe, portableserver {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, portableserver, messaging {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/run_test.pl b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/run_test.pl
new file mode 100644
index 00000000000..6a87492da33
--- /dev/null
+++ b/TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/run_test.pl
@@ -0,0 +1,37 @@
+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;
+
+$ior="MessengerServer.ior";
+unlink $ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $ior\n";
+ $S->Kill();
+ exit 1;
+}
+
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", "20");
+
+if ($C->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+unlink $ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/GracefulShutdown.mpc b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/GracefulShutdown.mpc
new file mode 100644
index 00000000000..9ef4e48adea
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/GracefulShutdown.mpc
@@ -0,0 +1,16 @@
+project(Multithreading*Server): taoexe, portableserver {
+ exename = MessengerServer
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ MessengerShutdownTimer.cpp
+ }
+}
+
+project(Multithreading*Client): taoexe {
+ exename = MessengerClient
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger.idl b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger.idl
new file mode 100644
index 00000000000..30bc8126513
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger.idl
@@ -0,0 +1,11 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+
+ oneway void shutdown();
+};
+
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerClient.cpp b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerClient.cpp
new file mode 100644
index 00000000000..5316eaffca3
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerClient.cpp
@@ -0,0 +1,81 @@
+#include "MessengerC.h"
+#include <ace/Get_Opt.h>
+#include <ace/Argv_Type_Converter.h>
+#include <iostream>
+
+int call_shutdown = 0;
+
+int parse_args (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("x"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'x':
+ call_shutdown = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n "
+ "-x - call shutdown on server\n",
+ argv[0]),
+ -1);
+
+ }
+ }
+ return 0;
+}
+
+int ACE_TMAIN( int argc, ACE_TCHAR* argv[] )
+{
+ try {
+ // Initialize the ORB.
+ ACE_Argv_Type_Converter conv(argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init(conv.get_argc(),
+ conv.get_TCHAR_argv());
+
+ // Parse arguments.
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << message.in() << std::endl;
+
+ // Shutdown server?
+ if (call_shutdown == 1)
+ {
+ messenger->shutdown();
+ orb->perform_work();
+ }
+
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp
new file mode 100644
index 00000000000..7ba804bc56a
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp
@@ -0,0 +1,221 @@
+#include "MessengerServer.h"
+#include "Messenger_i.h"
+#include "MessengerShutdownTimer.h"
+#include <ace/Get_Opt.h>
+#include <ace/Argv_Type_Converter.h>
+#include <ace/Reactor.h>
+#include <tao/ORB_Core.h>
+#include <iostream>
+#include <fstream>
+
+// By default, shutdown when client calls Messenger::shutdown().
+MessengerServer::ShutdownMethod s_method = MessengerServer::s_client_call;
+
+int loop_iterations;
+int timeout;
+
+// Constructor.
+MessengerServer::MessengerServer (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , monitor_(0)
+{
+}
+
+// Destructor.
+MessengerServer::~MessengerServer ()
+{
+ if (monitor_ != 0)
+ delete monitor_;
+ orb_->destroy ();
+}
+
+// run the ORB's event loop continuously
+void MessengerServer::run ()
+{
+ std::cout << "Running the ORB event loop continuously..." << std::endl;
+ orb_->run ();
+ std::cout << "Finished running the ORB." << std::endl;
+}
+
+// run the ORB's event loop for some number of seconds
+void MessengerServer::run (int seconds)
+{
+ std::cout << "Running the ORB event loop for " << seconds
+ << " seconds..." << std::endl;
+ ACE_Time_Value tv ((long)seconds, 0);
+ orb_->run (tv);
+ std::cout << "Finished running the ORB." << std::endl;
+}
+
+// handle ORB events in a polling loop for some number of iterations
+void MessengerServer::poll (int iterations)
+{
+ std::cout << "Polling for ORB events for " << iterations
+ << " iterations..." << std::endl;
+ int x = iterations;
+ do
+ {
+ std::cout << "iteration: " << iterations - x << std::endl;
+ ACE_Time_Value tv (1,0);
+ orb_->perform_work (tv);
+ }
+ while ((--x > 0) && (orb_->orb_core ()->has_shutdown() == 0));
+ std::cout << "Finished running the ORB." << std::endl;
+}
+
+// schedule a shutdown timer with the ORB's reactor to timeout
+// after some seconds
+void MessengerServer::schedule_shutdown_timer (int seconds)
+{
+ // Create a shutdown timer.
+ std::cout << "Creating shutdown timer" << std::endl;
+ MessengerShutdownTimer * timer = new MessengerShutdownTimer (orb_.in());
+
+ // Schedule the timer to shutdown the ORB, with no repeat.
+ ACE_Time_Value tv ((long)seconds, 0);
+ std::cout << "Scheduling shutdown timer" << std::endl;
+ orb_->orb_core ()->reactor ()->schedule_timer (
+ timer, // handler : ACE_Event_Handler *
+ 0, // args : void *
+ tv // relative timeout value : ACE_Time_Value &
+ );
+}
+
+// spawn thread to monitor console and shutdown on console input
+void MessengerServer::shutdown_on_console_input ()
+{
+ // Spawn a thread to monitor console and shutdown on console input.
+ monitor_ = new MessengerServer::ConsoleMonitor (orb_.in());
+ monitor_->activate ();
+ std::cout << "Enter any input on keyboard to shut down ORB..." << std::endl;
+}
+
+// parse arguments
+int MessengerServer::parse_args (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("xp:t:cr:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'x':
+ s_method = MessengerServer::s_client_call;
+ break;
+ case 'p':
+ s_method = MessengerServer::s_polling_loop;
+ loop_iterations = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case 't':
+ s_method = MessengerServer::s_timer;
+ timeout = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case 'c':
+ s_method = MessengerServer::s_console_input;
+ break;
+ case 'r':
+ s_method = MessengerServer::s_run_time_value;
+ timeout = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n "
+ "-x (default) - shutdown on client invocation\n"
+ "-p <n> - use polling loop for <n> iterations\n"
+ "-t <n> - schedule timer for <n> seconds\n"
+ "-c - shutdown on console input\n"
+ "-r <n> - run ORB for <n> seconds\n",
+ argv[0]),
+ -1);
+
+ }
+ }
+ return 0;
+}
+
+
+// ------------------------------------------------------------------
+// main
+// ------------------------------------------------------------------
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ ACE_Argv_Type_Converter conv(argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init(conv.get_argc(),
+ conv.get_TCHAR_argv());
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Messenger_i messenger_servant (orb.in());
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Create a MessengerServer object.
+ MessengerServer * server = new MessengerServer (orb.in());
+
+ // Parse arguments to determine how we should shutdown.
+ if (server->parse_args (argc, argv) != 0)
+ return 1;
+
+ switch (s_method)
+ {
+ // shutdown on client invocation
+ case MessengerServer::s_client_call:
+ std::cout << "Will shutdown on client invocation." << std::endl;
+ server->run ();
+ break;
+
+ // shutdown after some iterations through loop
+ case MessengerServer::s_polling_loop:
+ server->poll (loop_iterations);
+ break;
+
+ // schedule a timer to shutdown
+ case MessengerServer::s_timer:
+ server->schedule_shutdown_timer (timeout);
+ server->run ();
+ break;
+
+ // shutdown on console input
+ case MessengerServer::s_console_input:
+ server->shutdown_on_console_input ();
+ server->run ();
+ break;
+
+ // use CORBA::ORB::run() with time value
+ case MessengerServer::s_run_time_value:
+ server->run (timeout);
+ break;
+ }
+
+ // Finished.
+ delete server;
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.h b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.h
new file mode 100644
index 00000000000..5621cf17e1f
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.h
@@ -0,0 +1,74 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MESSENGERSERVER_H_
+#define MESSENGERSERVER_H_
+
+#include "MessengerS.h"
+#include <ace/Task.h>
+#include <iostream>
+
+//Class MessengerServer
+class MessengerServer
+{
+public:
+ //Constructor
+ MessengerServer (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~MessengerServer (void);
+
+ // parse arguments
+ int parse_args (int argc, ACE_TCHAR* argv[]);
+
+ // run the ORB's event loop continuously
+ void run ();
+
+ // run the ORB's event loop for some number of seconds
+ void run (int seconds);
+
+ // handle ORB events in a polling loop for some number of iterations
+ void poll (int iterations);
+
+ // schedule a shutdown timer with the ORB's reactor to timeout
+ // after some seconds
+ void schedule_shutdown_timer (int seconds);
+
+ // spawn thread to monitor console and shutdown on console input
+ void shutdown_on_console_input ();
+
+ enum ShutdownMethod {
+ s_client_call, // shutdown on client invocation
+ s_polling_loop, // shutdown after some iterations through loop
+ s_timer, // schedule a timer to shutdown
+ s_console_input, // shutdown on console input
+ s_run_time_value // use CORBA::ORB::run() with time value
+ };
+
+ // Task to monitor console input.
+ class ConsoleMonitor : public ACE_Task_Base
+ {
+ public:
+ ConsoleMonitor (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ {
+ }
+
+ virtual int svc()
+ {
+ char c;
+ std::cin.get (c);
+ orb_->shutdown (1);
+ return 0;
+ }
+ private:
+ CORBA::ORB_var orb_;
+ };
+
+private:
+
+ CORBA::ORB_var orb_;
+ ConsoleMonitor * monitor_;
+
+};
+
+#endif /* MESSENGERSERVER_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.cpp b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.cpp
new file mode 100644
index 00000000000..e16053c3933
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.cpp
@@ -0,0 +1,17 @@
+/* -*- C++ -*- $Id$ */
+
+#include "MessengerShutdownTimer.h"
+
+MessengerShutdownTimer::MessengerShutdownTimer (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+int MessengerShutdownTimer::handle_timeout (
+ const ACE_Time_Value &,
+ const void*)
+{
+ ACE_DEBUG((LM_DEBUG, "In MessengerShutdownTimer::handle_timeout\n"));
+ orb_->shutdown (0);
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.h b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.h
new file mode 100644
index 00000000000..07b8290ff41
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerShutdownTimer.h
@@ -0,0 +1,24 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MESSENGERSHUTDOWNTIMER_H_
+#define MESSENGERSHUTDOWNTIMER_H_
+
+#include <ace/Event_Handler.h>
+#include <tao/corba.h>
+
+class MessengerShutdownTimer : public ACE_Event_Handler
+{
+public:
+ // Constructor
+ MessengerShutdownTimer (CORBA::ORB_ptr orb);
+
+ virtual int handle_timeout (
+ const ACE_Time_Value & current_time,
+ const void * act);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+
+#endif /* MESSENGERSHUTDOWNTIMER_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.cpp b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.cpp
new file mode 100644
index 00000000000..f0a8ae0b4cb
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.cpp
@@ -0,0 +1,43 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::string_free(message);
+ message = CORBA::string_dup("Thanks for the message.");
+ return 1;
+}
+
+void Messenger_i::shutdown ()
+ throw(CORBA::SystemException)
+{
+ orb_->shutdown(0);
+}
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.h b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.h
new file mode 100644
index 00000000000..07e3829072f
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/Messenger_i.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+ virtual void shutdown ()
+ throw(CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+
+};
+
+#endif /* MESSENGER_I_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/README b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/README
new file mode 100644
index 00000000000..d0c42b5bc98
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/README
@@ -0,0 +1,63 @@
+File: DevGuideExamples/Multithreading/GracefulShutdown/README
+
+This directory contains a CORBA example illustrating a simple client
+and a server with an interface Messenger. This example extends the
+Getting Started example to show various techniques for gracefully
+shutting down a TAO server.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer [options]
+
+where [options] can be one of the following:
+
+ -x - (default) shutdown the ORB when the client invokes the
+ Messenger::shutdown() operation
+
+ -p <n> - use non-blocking ORB operations in a polling loop to shutdown
+ after <n> iterations
+
+ -t <n> - schedule a timer with the ORB's reactor to shutdown in
+ <n> seconds
+
+ -r <n> - use the overloaded version of CORBA::ORB::run() that takes
+ an ACE_Time_Value parameter indicating how long run()
+ should process events before returning, where <n> is the
+ number of seconds the ORB will run.
+
+ -c - spawn a separate thread to shutdown the ORB on any
+ input from the console (terminal)
+
+
+
+To start the client:
+------------------
+./MessengerClient [-x]
+
+where -x indicates the client will invoke Messenger::shutdown()
+on the server to shut it down.
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/run_test.pl b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/run_test.pl
new file mode 100644
index 00000000000..842015a4ff0
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/run_test.pl
@@ -0,0 +1,203 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+$server_args = "-ORBEndpoint iiop://localhost";
+
+# -------------------------------------------------------------------
+# Test 1: Shutdown on client invocation
+# -------------------------------------------------------------------
+
+# start MessengerServer
+
+print STDOUT "\n\nTest 1: Shutdown on client invocation.\n";
+print STDOUT "Running MessengerServer...\n";
+$S1 = new PerlACE::Process("MessengerServer", $server_args . " -x");
+$S1->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S1->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C1 = new PerlACE::Process("MessengerClient", "-x");
+$C1->Spawn();
+
+$C1RET = $C1->WaitKill(15);
+$S1->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($C1RET != 0) {
+ print STDERR "ERROR: Client returned <$C1RET>\n";
+ exit 1 ;
+}
+
+# -------------------------------------------------------------------
+# Test 2: Shutdown after <n> iterations through polling loop
+# -------------------------------------------------------------------
+
+# start MessengerServer
+
+$iter = 10;
+print STDOUT "\n\nTest 2: Shutdown after <$iter> iterations through polling loop.\n";
+print STDOUT "Running MessengerServer...\n";
+$S2 = new PerlACE::Process("MessengerServer", $server_args . " -p " . $iter);
+$S2->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S2->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C2 = new PerlACE::Process("MessengerClient");
+$C2->Spawn();
+
+$C2RET = $C2->WaitKill(15);
+$S2->WaitKill($iter+5);
+
+# clean-up
+
+unlink $ior;
+
+if ($C2RET != 0) {
+ print STDERR "ERROR: Client returned <$C2RET>\n";
+ exit 1 ;
+}
+
+# -------------------------------------------------------------------
+# Test 3: Schedule a timer with the ORB's reactor to shutdown
+# in <n> seconds
+# -------------------------------------------------------------------
+
+# start MessengerServer
+
+$sec = 10;
+print STDOUT "\n\nTest 3: Schedule a timer with the ORB's reactor to shutdown in <$sec> seconds.\n";
+print STDOUT "Running MessengerServer...\n";
+$S3 = new PerlACE::Process("MessengerServer", $server_args . " -t " . $sec);
+$S3->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S3->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C3 = new PerlACE::Process("MessengerClient");
+$C3->Spawn();
+
+$C3RET = $C3->WaitKill(15);
+$S3->WaitKill($sec+5);
+
+# clean-up
+
+unlink $ior;
+
+if ($C3RET != 0) {
+ print STDERR "ERROR: Client returned <$C3RET>\n";
+ exit 1 ;
+}
+
+# -------------------------------------------------------------------
+# Test 4: Use the overloaded version of CORBA::ORB::run() that takes
+# an ACE_Time_Value parameter indicating how long run()
+# should process events before returning.
+# -------------------------------------------------------------------
+
+# start MessengerServer
+
+print STDOUT "\n\nTest 4: Use the overloaded version of CORBA::ORB::run()\n";
+print STDOUT "that takes an ACE_Time_Value parameter indicating how long\n";
+print STDOUT "run() should process events before returning (<$sec> seconds).\n";
+print STDOUT "Running MessengerServer...\n";
+$S4 = new PerlACE::Process("MessengerServer", $server_args . " -r " . $sec);
+$S4->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S4->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C4 = new PerlACE::Process("MessengerClient");
+$C4->Spawn();
+
+$C4RET = $C4->WaitKill(15);
+$S4->WaitKill($sec+5);
+
+# clean-up
+
+unlink $ior;
+
+if ($C4RET != 0) {
+ print STDERR "ERROR: Client returned <$C4RET>\n";
+ exit 1 ;
+}
+
+
+# -------------------------------------------------------------------
+# Test 5: Spawn a separate thread to shutdown the ORB on any
+# input from the console (terminal)
+# -------------------------------------------------------------------
+
+# start MessengerServer
+
+print STDOUT "\n\nTest 5: Spawn a separate thread to shutdown the ORB on any input from the console (terminal).\n";
+print STDOUT "Running MessengerServer...\n";
+$S5 = new PerlACE::Process("MessengerServer", $server_args . " -c");
+$S5->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S5->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C5 = new PerlACE::Process("MessengerClient");
+$C5->Spawn();
+
+$C5RET = $C5->WaitKill(15);
+print STDOUT "Enter any input to shutdown MessengerServer...\n";
+$S5->WaitKill(15);
+
+# clean-up
+
+unlink $ior;
+
+if ($C5RET != 0) {
+ print STDERR "ERROR: Client returned <$C5RET>\n";
+ exit 1 ;
+}
+
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/README b/TAO/DevGuideExamples/Multithreading/README
new file mode 100644
index 00000000000..33afe107074
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/README
@@ -0,0 +1,21 @@
+File: DevGuideExamples/Multithreading/README
+
+
+This directory contains subdirectories containing CORBA examples
+illustrating TAO's various concurrency models:
+
+Reactive
+
+ Contains an example of a single-threaded server that uses the
+ reactive concurrency model.
+
+ThreadPerConnection
+
+ Contains an example of a multithreaded server that uses the
+ thread-per-connection concurrency model.
+
+ThreadPool
+
+ Contains an example of a multithreaded server that provides a pool
+ of threads for concurrent processing of client requests.
+
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/Messenger.idl b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger.idl
new file mode 100644
index 00000000000..335d899f058
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger.idl
@@ -0,0 +1,8 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/MessengerClient.cpp b/TAO/DevGuideExamples/Multithreading/Reactive/MessengerClient.cpp
new file mode 100644
index 00000000000..d3eac221e2c
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/MessengerClient.cpp
@@ -0,0 +1,36 @@
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << message.in() << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/MessengerServer.cpp b/TAO/DevGuideExamples/Multithreading/Reactive/MessengerServer.cpp
new file mode 100644
index 00000000000..2050c170c13
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/MessengerServer.cpp
@@ -0,0 +1,42 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.cpp b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.cpp
new file mode 100644
index 00000000000..abb3fdbc848
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.cpp
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+{
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ CORBA::string_free(message);
+ message = CORBA::string_dup("Thanks for the message.");
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.h b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.h
new file mode 100644
index 00000000000..af12e09474a
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/README b/TAO/DevGuideExamples/Multithreading/Reactive/README
new file mode 100644
index 00000000000..04a34332995
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/README
@@ -0,0 +1,48 @@
+File: DevGuideExamples/Multithreading/Reactive/README
+
+
+This directory contains a CORBA example illustrating a simple client and
+a server with an interface Messenger. The Messenger interface has
+an operation for sending a message (send_message). The MessengerClient
+will send a message which is displayed by the MessengerServer when
+received. The MessengerClient will then confirm that the message has
+been sent successfully.
+
+This version of the MessengerServer illustrates the single-threaded
+reactive concurrency model for servers as described in the
+Multithreading with TAO chapter. The svc.conf file shows run time
+configuration options for optimizing single-threaded TAO applications.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/Reactive.mpc b/TAO/DevGuideExamples/Multithreading/Reactive/Reactive.mpc
new file mode 100644
index 00000000000..d583bac9a11
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/Reactive.mpc
@@ -0,0 +1,13 @@
+project(Multithreading*Server): taoexe, portableserver, avoids_minimum_corba {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(Multithreading*Client): taoexe, avoids_minimum_corba {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/run_test.pl b/TAO/DevGuideExamples/Multithreading/Reactive/run_test.pl
new file mode 100644
index 00000000000..8fd94a64b3e
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/run_test.pl
@@ -0,0 +1,44 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+# start MessengerServer
+
+$S = new PerlACE::Process("MessengerServer", "-ORBEndpoint iiop://localhost");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start MessengerClient
+
+$C = new PerlACE::Process("MessengerClient");
+$C->Spawn();
+
+$CRET = $C->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/Reactive/svc.conf b/TAO/DevGuideExamples/Multithreading/Reactive/svc.conf
new file mode 100644
index 00000000000..3cd02504e29
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/Reactive/svc.conf
@@ -0,0 +1,4 @@
+# svc.conf file for single-threaded reactive server.
+static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock null"
+dynamic Advanced_Resource_Factory Service_Object * TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_st -ORBInputCDRAllocator null"
+static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler st"
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger.idl b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger.idl
new file mode 100644
index 00000000000..335d899f058
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger.idl
@@ -0,0 +1,8 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerClient.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerClient.cpp
new file mode 100644
index 00000000000..d3eac221e2c
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerClient.cpp
@@ -0,0 +1,36 @@
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << message.in() << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerServer.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerServer.cpp
new file mode 100644
index 00000000000..2050c170c13
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/MessengerServer.cpp
@@ -0,0 +1,42 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.cpp
new file mode 100644
index 00000000000..1ef3f40cf89
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.cpp
@@ -0,0 +1,41 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/Thread.h>
+#include <iostream>
+
+#include <sstream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char* /*user_name*/,
+ const char* /*subject*/,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+{
+ CORBA::string_free(message);
+
+ std::ostringstream ostr;
+ ostr << "Message handled on thread " << ACE_Thread::self();
+ message = CORBA::string_dup(ostr.str().c_str());
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.h b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.h
new file mode 100644
index 00000000000..af12e09474a
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/README b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/README
new file mode 100644
index 00000000000..ab8aff2ffcd
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/README
@@ -0,0 +1,71 @@
+File: DevGuideExamples/Multithreading/ThreadPerConnection/README
+
+
+This directory contains a CORBA example illustrating a simple client and
+a server with an interface Messenger. This example is based on the
+Getting Started example, but adds concurrent request processing
+capabilities to the server using the thread-per-connection concurrency
+model.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer -ORBSvcConf server.conf
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+Tip:
+----
+Run several clients simultaneously against the server. Each client
+should establish a separate connection to the server and each client's
+requests should be handled on a separate thread in the server. To
+verify this, the server returns the thread ID that handled the request
+in the reply message that is printed by the client.
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+Here is sample output from the Perl script:
+
+Starting MessengerServer
+IOR written to file Messenger.ior
+
+
+Starting 4 MessengerClients.
+Each client should get a new connection
+and its own thread in the server.
+
+Reply: Message handled on thread 992
+Reply: Message handled on thread 1952
+Reply: Message handled on thread 1676
+Reply: Message handled on thread 1016
+
+
+NOTE:
+
+ Since the Perl script starts several clients simultaneously, output
+ may become garbled since each client writes its output to stdout.
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/ThreadPerConnection.mpc b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/ThreadPerConnection.mpc
new file mode 100644
index 00000000000..6173af10a64
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/ThreadPerConnection.mpc
@@ -0,0 +1,13 @@
+project(Multithreading*Server): taoexe, portableserver {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(Multithreading*Client): taoexe, anytypecode {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/run_test.pl b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/run_test.pl
new file mode 100644
index 00000000000..63d67218306
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/run_test.pl
@@ -0,0 +1,74 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+# start MessengerServer
+
+print STDOUT "Starting MessengerServer\n";
+
+$S = new PerlACE::Process("MessengerServer", "-ORBSvcConf server.conf -ORBEndpoint iiop://localhost");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start several MessengerClients
+
+print STDOUT "\n\nStarting 4 MessengerClients.\n";
+print STDOUT "Each client should get a new connection \
+and its own thread in the server.\n\n";
+
+$C1 = new PerlACE::Process("MessengerClient");
+$C2 = new PerlACE::Process("MessengerClient");
+$C3 = new PerlACE::Process("MessengerClient");
+$C4 = new PerlACE::Process("MessengerClient");
+$C1->Spawn();
+$C2->Spawn();
+$C3->Spawn();
+$C4->Spawn();
+
+$C1RET = $C1->WaitKill(15);
+$C2RET = $C2->WaitKill(15);
+$C3RET = $C3->WaitKill(15);
+$C4RET = $C4->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($C1RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C1RET>\n";
+ exit 1 ;
+}
+
+if ($C2RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C2RET>\n";
+ exit 1 ;
+}
+
+if ($C3RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C3RET>\n";
+ exit 1 ;
+}
+
+if ($C4RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C4RET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/server.conf b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/server.conf
new file mode 100644
index 00000000000..3b6d80259ef
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPerConnection/server.conf
@@ -0,0 +1,2 @@
+# server.conf file for thread-per-connection server.
+static Server_Strategy_Factory "-ORBConcurrency thread-per-connection -ORBThreadPerConnectionTimeout 1000"
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger.idl b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger.idl
new file mode 100644
index 00000000000..335d899f058
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger.idl
@@ -0,0 +1,8 @@
+// Messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerClient.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerClient.cpp
new file mode 100644
index 00000000000..d3eac221e2c
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerClient.cpp
@@ -0,0 +1,36 @@
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Read and destringify the Messenger object's IOR.
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Could not get Messenger IOR." << std::endl;
+ return 1;
+ }
+
+ // Narrow the IOR to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "IOR was not a Messenger object reference." << std::endl;
+ return 1;
+ }
+
+ // Send a message the the Messenger object.
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ // Print the Messenger's reply.
+ std::cout << "Reply: " << message.in() << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerServer.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerServer.cpp
new file mode 100644
index 00000000000..af34d103c0d
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/MessengerServer.cpp
@@ -0,0 +1,73 @@
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+// 1. Define a "task" class for implenting the thread pool threads.
+#include <ace/Task.h>
+
+class ORB_Task : public ACE_Task_Base
+{
+public:
+ ORB_Task (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb)) { }
+ virtual ~ORB_Task () { }
+ virtual int svc ()
+ {
+ this->orb_->run();
+ return 0;
+ }
+private:
+ CORBA::ORB_var orb_;
+};
+
+// 2. Establish the number of threads.
+static const int nthreads = 4;
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //Get reference to the RootPOA.
+ CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
+ PortableServer::POA_var poa = PortableServer::POA::_narrow( obj.in() );
+
+ // Activate the POAManager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a servant.
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // 3. Create and activate threads for the thread pool.
+ ORB_Task task (orb.in());
+ int retval = task.activate (THR_NEW_LWP | THR_JOINABLE, nthreads);
+ if (retval != 0) {
+ std::cerr << "Failed to activate " << nthreads << " threads." << std::endl;
+ return 1;
+ }
+
+ // 4. Wait for threads to finish.
+ task.wait();
+
+ // Clean up.
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.cpp b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.cpp
new file mode 100644
index 00000000000..1ef3f40cf89
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.cpp
@@ -0,0 +1,41 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/Thread.h>
+#include <iostream>
+
+#include <sstream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char* /*user_name*/,
+ const char* /*subject*/,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+{
+ CORBA::string_free(message);
+
+ std::ostringstream ostr;
+ ostr << "Message handled on thread " << ACE_Thread::self();
+ message = CORBA::string_dup(ostr.str().c_str());
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.h b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.h
new file mode 100644
index 00000000000..af12e09474a
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/README b/TAO/DevGuideExamples/Multithreading/ThreadPool/README
new file mode 100644
index 00000000000..1c63df9bc76
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/README
@@ -0,0 +1,74 @@
+File: DevGuideExamples/Multithreading/ThreadPool/README
+
+
+This directory contains a CORBA example illustrating a simple client
+and a server with an interface Messenger. This example is based on the
+Getting Started example, but adds concurrent request processing
+capabilities to the server using the thread pool concurrency model.
+The server creates 4 threads for the thread pool.
+
+
+How to Run
+----------
+
+To start the server :
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+Tip:
+----
+Run several clients simultaneously against the server. Some client
+requests should be handled by separate threads in the server. To
+verify this, the server returns the thread ID that handled the request
+in the reply message that is printed by the client. You may see the
+same thread used to handle multiple requests, but it is unlikely that
+the same thread will be used to handle all of the requests.
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+Here is sample output from the Perl script:
+
+Starting MessengerServer
+IOR written to file Messenger.ior
+
+
+Starting 9 MessengerClients.
+The server should use different threads to handle requests.
+
+Reply: Message handled on thread 1620
+Reply: Message handled on thread 1620
+Reply: Message handled on thread 1620
+Reply: Message handled on thread 1868
+Reply: Message handled on thread 1592
+Reply: Message handled on thread 1868
+Reply: Message handled on thread 1300
+Reply: Message handled on thread 1620
+Reply: Message handled on thread 1620
+
+NOTE:
+
+ Since the Perl script starts several clients simultaneously, output
+ may become garbled since each client writes its output to stdout.
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/ThreadPool.mpc b/TAO/DevGuideExamples/Multithreading/ThreadPool/ThreadPool.mpc
new file mode 100644
index 00000000000..f2b2ee0a993
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/ThreadPool.mpc
@@ -0,0 +1,13 @@
+project(Multithreading*Server): taoexe, portableserver, avoids_minimum_corba {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(Multithreading*Client): taoexe, anytypecode, avoids_minimum_corba {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Multithreading/ThreadPool/run_test.pl b/TAO/DevGuideExamples/Multithreading/ThreadPool/run_test.pl
new file mode 100644
index 00000000000..d81c189697f
--- /dev/null
+++ b/TAO/DevGuideExamples/Multithreading/ThreadPool/run_test.pl
@@ -0,0 +1,113 @@
+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;
+
+$ior = PerlACE::LocalFile ("Messenger.ior");
+unlink $ior;
+
+# start MessengerServer
+
+print STDOUT "Starting MessengerServer\n";
+
+$S = new PerlACE::Process("MessengerServer", "-ORBEndpoint iiop://localhost");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+# start several MessengerClients
+
+print STDOUT "\n\nStarting 9 MessengerClients.\n";
+print STDOUT "The server should use different threads to handle requests.\n\n";
+
+$C1 = new PerlACE::Process("MessengerClient");
+$C2 = new PerlACE::Process("MessengerClient");
+$C3 = new PerlACE::Process("MessengerClient");
+$C4 = new PerlACE::Process("MessengerClient");
+$C5 = new PerlACE::Process("MessengerClient");
+$C6 = new PerlACE::Process("MessengerClient");
+$C7 = new PerlACE::Process("MessengerClient");
+$C8 = new PerlACE::Process("MessengerClient");
+$C9 = new PerlACE::Process("MessengerClient");
+$C1->Spawn();
+$C2->Spawn();
+$C3->Spawn();
+$C4->Spawn();
+$C5->Spawn();
+$C6->Spawn();
+$C7->Spawn();
+$C8->Spawn();
+$C9->Spawn();
+
+$C1RET = $C1->WaitKill(15);
+$C2RET = $C2->WaitKill(15);
+$C3RET = $C3->WaitKill(15);
+$C4RET = $C4->WaitKill(15);
+$C5RET = $C5->WaitKill(15);
+$C6RET = $C6->WaitKill(15);
+$C7RET = $C7->WaitKill(15);
+$C8RET = $C8->WaitKill(15);
+$C9RET = $C9->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($C1RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C1RET>\n";
+ exit 1 ;
+}
+
+if ($C2RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C2RET>\n";
+ exit 1 ;
+}
+
+if ($C3RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C3RET>\n";
+ exit 1 ;
+}
+
+if ($C4RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C4RET>\n";
+ exit 1 ;
+}
+
+if ($C5RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C5RET>\n";
+ exit 1 ;
+}
+
+if ($C6RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C6RET>\n";
+ exit 1 ;
+}
+
+if ($C7RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C7RET>\n";
+ exit 1 ;
+}
+
+if ($C8RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C8RET>\n";
+ exit 1 ;
+}
+
+if ($C9RET != 0) {
+ print STDERR "ERROR: Client 1 returned <$C9RET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/Messenger.idl b/TAO/DevGuideExamples/NamingService/Messenger/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/Messenger.mpc b/TAO/DevGuideExamples/NamingService/Messenger/Messenger.mpc
new file mode 100644
index 00000000000..af04735e956
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/Messenger.mpc
@@ -0,0 +1,13 @@
+project(NamingService*Server): namingexe, naming_skel {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(NamingService*Client): namingexe {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/MessengerClient.cpp b/TAO/DevGuideExamples/NamingService/Messenger/MessengerClient.cpp
new file mode 100644
index 00000000000..47d4117d0fd
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/MessengerClient.cpp
@@ -0,0 +1,50 @@
+
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Find the Naming Service
+ CORBA::Object_var naming_obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root =
+ CosNaming::NamingContextExt::_narrow(naming_obj.in());
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Resolve the Messenger object
+ CosNaming::Name name;
+ name.length( 2 );
+ name[0].id = CORBA::string_dup( "example" );
+ name[1].id = CORBA::string_dup( "Messenger" );
+ CORBA::Object_var obj = root->resolve_str("example/Messenger");
+
+ // Narrow the Messenger object reference
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+
+ // Send a message
+ messenger->send_message("TAO User", "TAO Test", message.inout());
+
+ std::cout << "Message was sent" << std::endl;
+
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/NamingService/Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..3335ca8eb2d
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/MessengerServer.cpp
@@ -0,0 +1,63 @@
+
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Find the Naming Service
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references( "NameService" );
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow( naming_obj.in() );
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Bind the example Naming Context, if necessary
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup( "example" );
+ try {
+ CORBA::Object_var dummy = root->resolve( name );
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy = root->bind_new_context( name );
+ }
+
+ // Bind the Messenger object
+ name.length( 2 );
+ name[1].id = CORBA::string_dup( "Messenger" );
+
+ // Create an object
+ Messenger_i messenger_servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&messenger_servant);
+ obj = poa->id_to_reference( oid.in() );
+ root->rebind(name, obj.in());
+
+ std::cout << "Messenger object bound in Naming Service" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..8215d5e4cef
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.cpp
@@ -0,0 +1,34 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.h b/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.h
new file mode 100644
index 00000000000..e386c4c71da
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/README b/TAO/DevGuideExamples/NamingService/Messenger/README
new file mode 100644
index 00000000000..3fe9385257c
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/README
@@ -0,0 +1,43 @@
+OMG Naming Service
+
+File: DevGuideExamples/NamingService/Messenger/README
+
+
+The Original Messenger example, introduced in Chapters 4 and 5
+(GettingStartedUNIX and GettingStartedVC), is modified to utilize the
+Naming Service. The client now uses the Naming Service rather than
+reading the server object's IOR as a string from a file.
+
+The Client code is stored in:
+
+DevGuideExamples/NamingService/Messenger/MessengerClient.cpp
+
+The Server code is stored in:
+
+DevGuideExamples/NamingService/Messenger/MessengerServer.cpp
+
+
+How to Run
+----------
+
+To start the Naming_Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the server:
+------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the client:
+------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the three steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
diff --git a/TAO/DevGuideExamples/NamingService/Messenger/run_test.pl b/TAO/DevGuideExamples/NamingService/Messenger/run_test.pl
new file mode 100644
index 00000000000..6042d28aef5
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Messenger/run_test.pl
@@ -0,0 +1,58 @@
+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;
+
+
+$TARGETHOSTNAME = "localhost";
+$def_port = 2809;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Give the server some time
+# to bind the object reference
+# with the Naming Service
+sleep 3;
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+
+if ($C->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $S->Kill();
+ $NS->Kill();
+ exit 1;
+}
+
+# clean-up
+
+$C->Kill();
+$S->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger.idl b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerClient.cpp b/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerClient.cpp
new file mode 100644
index 00000000000..97b470fe7de
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerClient.cpp
@@ -0,0 +1,46 @@
+
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/Naming/Naming_Client.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Find the Naming Service
+ TAO_Naming_Client naming_client;
+
+ if (naming_client.init (orb.in ()) != 0) {
+ std::cerr << "Could not initialize naming client." << std::endl;
+ return 1;
+ }
+
+ // Resolve the Messenger object
+ CosNaming::Name name;
+ name.length( 2 );
+ name[0].id = CORBA::string_dup( "example" );
+ name[1].id = CORBA::string_dup( "Messenger" );
+ CORBA::Object_var obj = naming_client->resolve(name);
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ std::cout << "Message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerServer.cpp b/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerServer.cpp
new file mode 100644
index 00000000000..e43928265fe
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/MessengerServer.cpp
@@ -0,0 +1,62 @@
+
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/Naming/Naming_Client.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Find the Naming Service
+ TAO_Naming_Client naming_client;
+
+ if(naming_client.init(orb.in()) != 0){
+ std::cerr << "Could not initialize naming client." << std::endl;
+ return 1;
+ }
+
+ // Bind the example Naming Context, if necessary
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id = CORBA::string_dup("example");
+ try {
+ CORBA::Object_var dummy = naming_client->resolve(name);
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy = naming_client->bind_new_context( name );
+ }
+
+ // Bind the Messenger object
+ name.length( 2 );
+ name[1].id = CORBA::string_dup( "Messenger" );
+
+ // Create an object
+ Messenger_i servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ naming_client->rebind(name, obj.in());
+
+ std::cout << "Messenger object bound in Naming Service" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.cpp
new file mode 100644
index 00000000000..bf7f62b4262
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.cpp
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ std::cout << "Hello";
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.h b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.h
new file mode 100644
index 00000000000..e386c4c71da
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/Naming_Client.mpc b/TAO/DevGuideExamples/NamingService/Naming_Client/Naming_Client.mpc
new file mode 100644
index 00000000000..06588cc5311
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/Naming_Client.mpc
@@ -0,0 +1,13 @@
+project(*Server): namingexe, naming_skel {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): namingexe {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/README b/TAO/DevGuideExamples/NamingService/Naming_Client/README
new file mode 100644
index 00000000000..097832f20c3
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/README
@@ -0,0 +1,45 @@
+OMG Naming Service
+
+File: DevGuideExamples/NamingService/Naming_Client/README
+
+
+The example in this directory is a modification of the code given
+in the NamingService/Messenger example. It illustrates how to use the
+TAO_Naming_Client class for accessing the Naming Service. This class
+simplifies the interface for accessing and using the Naming Service.
+The TAO_Naming_Client class is used by both the Client and
+Server to access the Naming Service.
+
+The Client code is stored in:
+
+DevGuideExamples/NamingService/Naming_Client/MessengerClient.cpp
+
+The Server code is stored in:
+
+DevGuideExamples/NamingService/Naming_Client/MessengerServer.cpp
+
+
+How to Run
+----------
+
+To start the Naming_Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior
+
+To start the server:
+------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the client:
+------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the three steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Client/run_test.pl b/TAO/DevGuideExamples/NamingService/Naming_Client/run_test.pl
new file mode 100644
index 00000000000..74ab7ac6f5a
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Client/run_test.pl
@@ -0,0 +1,61 @@
+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;
+
+
+$TARGETHOSTNAME = "localhost";
+$def_port = 2809;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start MessengerServer
+$MessengerServer = "MessengerServer";
+$S = new PerlACE::Process($MessengerServer, $arg_ns_ref);
+$S->Spawn();
+
+# Give the server some time
+# to bind the object reference
+# with the Naming Service
+sleep 3;
+
+# start MessengerClient
+$MessengerClient = "MessengerClient";
+$C = new PerlACE::Process($MessengerClient, $arg_ns_ref );
+
+if ($C->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $S->Kill();
+ $NS->Kill();
+ exit 1;
+}
+
+
+# clean-up
+
+$C->Kill();
+$S->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger.idl b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerClient.cpp b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerClient.cpp
new file mode 100644
index 00000000000..246ca22262d
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerClient.cpp
@@ -0,0 +1,50 @@
+
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+#include <fstream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ char url[200];
+ std::ifstream iorFile( "url.ior" );
+ iorFile >> url;
+ iorFile.close();
+
+ std::cout << "url: " << url << std::endl;
+
+ // Find the Naming Service & the Message Server name in it
+ CORBA::Object_var obj = orb->string_to_object(url);
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+ messenger->send_message( "TAO User", "TAO Test", message.inout());
+
+ std::cout << "Message was sent" << std::endl;
+
+ std::cout << "Now try the same thing with the simple name." << std::endl;
+ obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+ obj = root->resolve_str("Simple/Messenger");
+ messenger = Messenger::_narrow(obj.in());
+ messenger->send_message( "ACE User", "TAO Test", message.inout());
+
+ std::cout << "Message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerServer.cpp b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerServer.cpp
new file mode 100644
index 00000000000..9b1307f477b
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/MessengerServer.cpp
@@ -0,0 +1,127 @@
+
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+#include <fstream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ //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();
+
+ // Find the Naming Service
+ obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var root =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Bind a new context.
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup( "root.esc-dot" );
+ name[0].kind = CORBA::string_dup( "kind1" );
+
+ try {
+ obj = root->resolve(name);
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy = root->bind_new_context(name);
+ }
+
+ name.length( 2 );
+ name[1].id = CORBA::string_dup( "leaf/esc-slash" );
+ name[1].kind = CORBA::string_dup( "kind2" );
+
+ // Create an object
+ Messenger_i servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var messenger_obj = poa->id_to_reference(oid.in());
+ root->rebind(name, messenger_obj.in());
+
+ // Also try rebinding to a simple path.
+ CosNaming::Name_var simp_name = root->to_name("Simple");
+ try {
+ obj = root->resolve(simp_name.in());
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy =
+ root->bind_new_context(simp_name.in());
+ }
+ simp_name = root->to_name("Simple/Messenger");
+ root->rebind(simp_name.in(), messenger_obj.in());
+
+ // Convert Name to String Name.
+ CORBA::String_var str_name = root->to_string(name);
+ std::cout << "str_name: " << str_name.in() << std::endl;
+ CORBA::String_var str_simple = root->to_string(simp_name.in());
+ std::cout << "simple: " << str_simple.in() << std::endl;
+
+ // Convert String Name to Name.
+ CosNaming::Name_var tname = root->to_name(str_name.in());
+
+ std::cout << "converted back to a CosNaming::Name: " << std::endl;
+ std::cout << " name[0] = " << (* tname)[0].id.in() << " , "
+ << (* tname)[0].kind.in() << std::endl;
+ std::cout << " name[1] = " << (* tname)[1].id.in() << " , "
+ << (* tname)[1].kind.in() << std::endl;
+
+ // Find the application object by resolve_str.
+ try {
+ obj = root->resolve_str(str_name.in());
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ std::cerr<<"Couldn't resolve the string name: " << str_name << std::endl;
+ return 1;
+ }
+
+ // Create an URL string for application object.
+ CORBA::String_var address = CORBA::string_dup (":localhost:2809/key/str");
+
+ std::cout << "call to_url(\"" << address.in() << "\"" << std::endl;
+ std::cout << " ,\"" << str_simple.in() << "\")"<< std::endl;
+
+ CORBA::String_var url_string = root->to_url(address.in(), str_simple.in());
+
+ std::cout << "to_url result: " << url_string.in() << std::endl;
+
+
+ // Write NS url to a file to let client read NS URL to get
+ // NamingContext reference.
+ CORBA::String_var ns_addr = CORBA::string_dup(":localhost:2809");
+
+ std::cout << "call to_url(\"" <<ns_addr.in() << "\",\""
+ << str_simple.in() << "\")"<< std::endl;
+
+ CORBA::String_var url = root->to_url(ns_addr.in(), str_simple.in());
+ std::cout << "to_url result: " << url.in() << std::endl;
+
+
+ std::ofstream iorFile("url.ior");
+ iorFile << url.in() << std::endl;
+ iorFile.close();
+
+ std::cout << "Naming Service URL written to file url.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.cpp
new file mode 100644
index 00000000000..bf37e302a03
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.cpp
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.h b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.h
new file mode 100644
index 00000000000..c94ed6ed7ae
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc
new file mode 100644
index 00000000000..06588cc5311
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/Naming_Context_Ext.mpc
@@ -0,0 +1,13 @@
+project(*Server): namingexe, naming_skel {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): namingexe {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/README b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/README
new file mode 100644
index 00000000000..956b719eadf
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/README
@@ -0,0 +1,32 @@
+
+DevGuideExamples/NamingService/Naming_Context_Ext/README
+
+The example in this directory illustratues how to convert between CosNames,
+Stringified Names, and URLs.
+
+A Name can be converted to a stringified Name by to_string operation. A stringified
+Name can be converted to a Name by to_name operation. The resolve_str operation
+resolves an object by passing a strigified Name.
+
+The MessengerServer writes its corbaname URL to a file by calling to_url and
+the MessengerClient reads the URL file to get the MessengerServer object reference.
+
+
+
+How to Run:
+-----------
+To start the Naming_Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -ORBEndPoint iiop://localhost:2809 &
+
+
+To start the server:
+------------------
+./MessengerServer -ORBInitRef NameService=iiop://localhost:2809/NameService
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/run_test.pl b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/run_test.pl
new file mode 100644
index 00000000000..d67c19f4ba7
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Context_Ext/run_test.pl
@@ -0,0 +1,54 @@
+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;
+
+$nsref="-ORBInitRef NameService=iiop://localhost:2809/NameService";
+$nsior = "ns.ior";
+$ior="url.ior";
+unlink $ior;
+
+# start Naming Service
+unlink($nsior);
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-ORBEndPoint iiop://localhost:2809 -o $nsior");
+$NS->Spawn();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$nsior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$MessengerServer = "MessengerServer";
+$S = new PerlACE::Process($MessengerServer, $nsref );
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file $ior\n";
+ $NS->Kill();
+ $S->Kill();
+ exit 1;
+}
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $nsref);
+if ($C->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $S->Kill();
+ $NS->Kill();
+ exit 1;
+}
+
+# clean-up
+$S->Kill();
+$NS->Kill();
+unlink $ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger.idl b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.cpp b/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.cpp
new file mode 100644
index 00000000000..05fa548cd75
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.cpp
@@ -0,0 +1,82 @@
+#include "MessengerTask.h"
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+MessengerTask::MessengerTask()
+{
+ // cast away constness to make Sun CC family of compilers happy.
+ char* argv[] = {const_cast<char *>("Messenger"), 0 };
+ int argc = 1;
+ orb_ = CORBA::ORB_init(argc, argv, "ServerORB");
+}
+
+void MessengerTask::end()
+{
+ orb_->shutdown(0);
+ wait();
+}
+
+int MessengerTask::svc()
+{
+
+ 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();
+
+ // Find the Naming Service
+ obj = orb_->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow(obj.in());
+
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+ // Bind the example Naming Context, if necessary
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id = CORBA::string_dup("example");
+ try {
+ root->resolve(name);
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ root->bind_new_context(name);
+ }
+
+ // Bind the Messenger object
+ name.length(2);
+ name[1].id = CORBA::string_dup("Messenger");
+
+ // Create an object
+ Messenger_i servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ root->rebind(name, obj.in());
+
+ std::cout << "Messenger object bound in Naming Service" << std::endl;
+
+ // Normally we run the orb and the orb is shutdown by
+ // calling MessengerTask::end(). To simplify the coordination
+ // between the main thread and this Messenger thread, specify
+ // the time period to let the Messenger thread finish by itself.
+ // Accept requests
+ ACE_Time_Value tv(1);
+ orb_->run(tv);
+ orb_->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "CORBA exception: " << ex << std::endl;
+ }
+
+ return -1;
+}
+
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.h b/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.h
new file mode 100644
index 00000000000..bf6f5ea22fb
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/MessengerTask.h
@@ -0,0 +1,18 @@
+#ifndef MESSENGERTASK_H
+#define MESSENGERTASK_H
+
+#include <tao/corba.h>
+#include <ace/Task.h>
+
+class MessengerTask : public ACE_Task_Base
+{
+public:
+ MessengerTask();
+ virtual int svc();
+
+ void end();
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.cpp
new file mode 100644
index 00000000000..63306d0951e
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.cpp
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.h b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.h
new file mode 100644
index 00000000000..c94ed6ed7ae
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/Messenger_i.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/NamingMessenger.cpp b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingMessenger.cpp
new file mode 100644
index 00000000000..8b1eac7a372
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingMessenger.cpp
@@ -0,0 +1,23 @@
+#include "NamingTask.h"
+#include "MessengerTask.h"
+#include <ace/OS.h>
+
+int main(int argc, char* argv[])
+{
+ // Start the Naming Service task
+ NamingTask namingService(argc, argv);
+ namingService.activate();
+ // Wait for the Naming Service initialized.
+ namingService.waitInit();
+
+ // Start the Messenger task
+ MessengerTask messenger;
+ messenger.activate();
+
+ // Wait the Messenger task finish.
+ messenger.wait();
+ // Shutdown the Naming Service.
+ namingService.end();
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.cpp b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.cpp
new file mode 100644
index 00000000000..fae419b9364
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.cpp
@@ -0,0 +1,64 @@
+#include "NamingTask.h"
+#include <orbsvcs/Naming/Naming_Server.h>
+#include <ace/OS_NS_unistd.h>
+#include <iostream>
+
+NamingTask::NamingTask (int argc, char** argv)
+: argc_ (argc),
+ argv_ (argv),
+ initialized_(false)
+{
+ orb_ = CORBA::ORB_init(argc, argv, "NamingORB");
+}
+
+void NamingTask::waitInit ()
+{
+ // Wait for Naming Service initialized.
+ while (! initialized_) {
+ ACE_OS::sleep(ACE_Time_Value(0, 100 * 1000));
+ }
+}
+
+void NamingTask::end()
+{
+ orb_->shutdown(0);
+ wait();
+}
+
+int NamingTask::svc()
+{
+ 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 poaManager = poa->the_POAManager();
+ poaManager->activate();
+
+ // Initialize the naming service
+ // We are not going to look for other naming servers
+ TAO_Naming_Server naming;
+ if (naming.init(orb_.in(),
+ poa.in(),
+ ACE_DEFAULT_MAP_SIZE,
+ 0,
+ 0) == 0) {
+ std::cout << "The Naming Service Task is ready." << std::endl;
+ initialized_ = true;
+ // Accept requests
+ orb_->run();
+ orb_->destroy();
+ return 0;
+ }
+ else {
+ std::cerr << "Unable to initialize the Naming Service." << std::endl;
+ }
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "NamingTask::svc() CORBA::Exception: " << ex << std::endl;
+ }
+
+ return -1;
+}
+
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.h b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.h
new file mode 100644
index 00000000000..9c7756497cf
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/NamingTask.h
@@ -0,0 +1,22 @@
+#ifndef NAMINGTASK_H
+#define NAMINGTASK_H
+
+#include <tao/corba.h>
+#include <ace/Task.h>
+
+class NamingTask : public ACE_Task<ACE_MT_SYNCH>
+{
+public:
+ NamingTask (int argc, char** argv);
+ virtual int svc();
+ void waitInit ();
+ void end();
+
+private:
+ int argc_;
+ char **argv_;
+ CORBA::ORB_var orb_;
+ bool initialized_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/Naming_Server.mpc b/TAO/DevGuideExamples/NamingService/Naming_Server/Naming_Server.mpc
new file mode 100644
index 00000000000..225dcbfea04
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/Naming_Server.mpc
@@ -0,0 +1,3 @@
+project(*Messenger): namingexe, naming_serv {
+ requires += threads
+}
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/README b/TAO/DevGuideExamples/NamingService/Naming_Server/README
new file mode 100644
index 00000000000..0660fa94e7e
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/README
@@ -0,0 +1,39 @@
+OMG Naming Service
+
+File: DevGuideExamples/NamingService/Naming_Server/README
+
+The example in NamingService/Naming_Client is modified to utilize
+the TAO_Naming_Server class. This class enables the Naming Service
+to easily be collocated within an application. In this example,
+the Naming Service is collocated with a server that supports the
+Messenger Interface described in GettingStartedUNIX (or GettingStartedVC).
+
+The Server code is stored in:
+
+DevGuideExamples/NamingService/Naming_Server/MessengerServer.cpp
+
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer -o ns.ior
+
+To start the client:
+------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the three steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE: This example has been changed from the example that appears in the
+dev-guide in order to pass command line parameters to the thread
+that runs the naming server.
diff --git a/TAO/DevGuideExamples/NamingService/Naming_Server/run_test.pl b/TAO/DevGuideExamples/NamingService/Naming_Server/run_test.pl
new file mode 100644
index 00000000000..d2e2b3e0830
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/Naming_Server/run_test.pl
@@ -0,0 +1,18 @@
+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;
+
+$CS = new PerlACE::Process("NamingMessenger");
+
+if ($CS->SpawnWaitKill(10) != 0) {
+ exit 1;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger.idl b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerClient.cpp b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerClient.cpp
new file mode 100644
index 00000000000..a57f0676f92
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerClient.cpp
@@ -0,0 +1,53 @@
+
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ const char* url = "corbaloc:rir:/NameService"; // default URL to InitRef
+ if ( argc < 2 ) {
+ std::cout << "Defaulting URL to " << url << std::endl;
+ std::cout << "Usage: " << argv[0]
+ << " [corbaloc URL] [-ORB options]" << std::endl;
+ }
+ else {
+ url = argv[1];
+ }
+
+ // Find the Naming Service
+ CORBA::Object_var obj = orb->string_to_object(url);
+
+ CosNaming::NamingContextExt_var root =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Resolve the Messenger object
+ obj = root->resolve_str("example/Messenger");
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message("TAO User", "TAO Test", message.inout());
+
+ std::cout << "Message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "client:Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..47d29379dc4
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/MessengerServer.cpp
@@ -0,0 +1,63 @@
+
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+
+ // Find the Naming Service
+ obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow(obj.in());
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Bind the example Naming Context, if necessary
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup("example");
+ try {
+ obj = root->resolve(name);
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy = root->bind_new_context(name);
+ }
+
+ // Bind the Messenger object
+ name.length(2);
+ name[1].id = CORBA::string_dup("Messenger");
+
+ // Create an object
+ Messenger_i servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ root->rebind(name, messenger.in());
+
+ std::cout << "Messenger object bound in Naming Service" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "server: Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..8f75d589951
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.cpp
@@ -0,0 +1,33 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.h b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.h
new file mode 100644
index 00000000000..e386c4c71da
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/README b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/README
new file mode 100644
index 00000000000..94d7be77c45
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/README
@@ -0,0 +1,171 @@
+
+DevGuideExamples/NamingService/corbaloc_Messenger/README
+
+The example in this directory extends the example in GettingStartedUNIX
+(or GettingStartedVC) to use the Naming_Service
+and calling string_to_object instead of calling resolve_initial_references
+to get the NameService object reference.
+
+This example only differs from the NamingService/Messenger example by a few lines
+in the MessengerClient.cpp. (All other source files should be the same.)
+
+How to Run:
+-----------
+To start the Naming_Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -m 1 &
+
+Note: Must start the Naming_Service using multicast (-m 1)
+ for the default initial reference for NameService to work.
+
+To start the server:
+------------------
+./MessengerServer
+To start the client:
+------------------
+./MessengerClient
+
+
+This MessengerClient will optionally take parameter that is a URL (corbaloc:)
+that addresses the Naming_Service.
+
+The MessengerServer and MessengerClient may also take an -ORBInitRef option
+to help qualify the address of the Naming_Service.
+
+Here are some examples:
+
+REM start the name server
+cd/d %TAO_ROOT%\orbsvcs\Naming_Service
+title NS
+Naming_Service -ORBEndpoint iiop://localhost:2809 -m 0
+
+REM start the example server
+cd/d %EXAMPLES%\NamingService\corbaloc_Messenger\Debug
+title server
+REM use -ORBInitRef with IIOP
+MessengerServer -ORBInitRef NameService=iiop://localhost:2809/NameService
+
+REM use -ORBDefaultInitRef with specific host and port
+MessengerServer -ORBDefaultInitRef iiop://localhost:2809
+
+REMuse -ORBDefaultInitRef <port 2809 is the default if not specified.
+MessengerServer -ORBDefaultInitRef corbaloc::localhost
+
+REM crashes - ? is this a bug?
+MessengerServer -ORBDefaultInitRef corbaloc:rir:/
+
+REM -ORBInitRef with corbaloc and default port
+MessengerServer -ORBInitRef NameService=corbaloc::localhost/NameService
+REM and specific port
+MessengerServer -ORBInitRef NameService=corbaloc::localhost:2809/NameService
+
+REM crashes
+MessengerServer -ORBInitRef NameService=corbaloc:rir/NameService
+
+REM start the client
+cd/d %EXAMPLES%\NamingService\corbaloc_Messenger\Debug
+title client
+MessengerClient -ORBInitRef NameService=iiop://localhost:2809/NameService corbaloc:rir:/NameService
+
+
+REM use -ORBDefaultInitRef with specific host and default port == 2809
+MessengerClient -ORBDefaultInitRef corbaloc::localhost corbaloc:rir:/NameService
+
+REM use a corbaloc that does not require -ORBDefaultInitRef (port defaults)
+MessengerClient corbaloc::localhost/NameService
+
+===========================
+REM !!! kill the previous Naming_Service and MessengerServer !!!
+
+REM start the name server (at another address)
+cd/d %TAO_ROOT%\orbsvcs\Naming_Service
+Naming_Service -ORBEndpoint iiop://localhost:9999 -m 0
+
+REM start the example server
+cd/d %EXAMPLES%\NamingService\corbaloc_Messenger\Debug
+MessengerServer -ORBInitRef NameService=iiop://localhost:9999/NameService
+
+
+
+REM start the client
+cd/d %EXAMPLES%\NamingService\corbaloc_Messenger\Debug
+MessengerClient -ORBInitRef NameService=iiop://localhost:9999/NameService
+
+
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9999/NameService
+Usage: MessengerClient [-ORB options] [corbaname URL for the name service]
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9999/NameService corbaloc:rir:/NameService
+Message was sent
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9999/NameService corbaloc:rir:/
+Message was sent
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc:rir:/
+Caught a CORBA exception: TRANSIENT (IDL:omg.org/CORBA/TRANSIENT:1.0)
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc:iiop:localhost:9999/NameService
+Message was sent
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc:localhost:9999/NameService
+TAO (249|231) no usable transport protocol was found.
+Caught a CORBA exception: BAD_PARAM (IDL:omg.org/CORBA/BAD_PARAM:1.0)
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc::localhost:9999/NameService
+Message was sent
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc::1.0\localhost:9999/NameService
+Caught a CORBA exception: TRANSIENT (IDL:omg.org/CORBA/TRANSIENT:1.0)
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc::1.0\@localhost:9999/NameService
+Caught a CORBA exception: TRANSIENT (IDL:omg.org/CORBA/TRANSIENT:1.0)
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc::localhost:9999/NameService
+Message was sent
+
+MessengerClient -ORBInitRef NameService=iiop://localhost:9669/NameService corbaloc::localhost/NameService
+Caught a CORBA exception: TRANSIENT (IDL:omg.org/CORBA/TRANSIENT:1.0)
+
+
+
+===================== IIOPLOC =================
+REM iioploc: is TAO specific and deprecated
+
+REM start the name server
+cd/d %TAO_ROOT%\orbsvcs\Naming_Service
+title NS
+Naming_Service -ORBEndpoint iiop://localhost:2809 -m 0
+
+REM -ORBInitRef with iioploc (TAO specific and deprecated)
+MessengerServer -ORBInitRef NameService=iioploc://localhost:2809/NameService
+
+cd/d %EXAMPLES%\NamingService\corbaloc_Messenger\Debug
+title client
+MessengerClient iioploc://localhost:2809/NameService
+
+===== MCAST example ======
+!!! only on platforms supporting multicast (not Windows) !!!
+
+
+# start the name server using MultiCast
+cd $TAO_ROOT/orbsvcs/Naming_Service
+Naming_Service -m 1
+
+# start the example server
+cd $EXAMPLES/NamingService/corbaloc_Messenger
+MessengerServer
+
+cd $EXAMPLES/NamingService/corbaloc_Messenger
+MessengerClient
+
+
+--- specify the multicast address.
+Naming_Service -m 1 -ORBNameServicePort 12345
+# -ORBNameServicePort 12345 is ingored if -m 1 is not specified.
+
+
+MessengerServer -ORBInitRef NameService=mcast://:12345::/NameService
+
+
+<TBD more using URL parameter>
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc
new file mode 100644
index 00000000000..06588cc5311
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/corbaloc_Messenger.mpc
@@ -0,0 +1,13 @@
+project(*Server): namingexe, naming_skel {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): namingexe {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/run_test.pl b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/run_test.pl
new file mode 100644
index 00000000000..82ff480aca7
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaloc_Messenger/run_test.pl
@@ -0,0 +1,109 @@
+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;
+
+
+$TARGETHOSTNAME = "localhost";
+$def_port = 2809;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-ORBEndpoint iiop://$TARGETHOSTNAME:$def_port");
+$NS->Spawn();
+
+sleep(1);
+
+# List of tests to test corbaloc URL syntax.
+@corbaloc_servers = ( "-ORBDefaultInitRef corbaloc::$TARGETHOSTNAME",
+ "-ORBInitRef NameService=corbaloc::$TARGETHOSTNAME/NameService",
+ "-ORBInitRef NameService=corbaloc::$TARGETHOSTNAME:$def_port/NameService");
+
+
+@servers_comments = ( "Using -ORBDefaultInitRef with default port $def_port and default transport IIOP: \n",
+ "Using -ORBInitRef with corbaloc URL: \n",
+ "Using -ORBInitRef with corbaloc URL and specified port: \n");
+
+@corbaloc_clients = ( "corbaloc::$TARGETHOSTNAME/NameService",
+ "-ORBInitRef NameService=iiop://$TARGETHOSTNAME:$def_port/NameService corbaloc:rir:/NameService");
+
+@clients_comments = ( "Using the URL parameter: \n");
+ "Using a corbaloc:rir form URL(must specify initial reference): \n",
+
+
+
+
+$MessengerServer= "MessengerServer";
+$MessengerClient= "MessengerClient";
+
+$test_number = 0;
+
+foreach $o (@corbaloc_servers) {
+
+ # Run messenger server for each test.
+ #print "Start $MessengerServer $o \n";
+ $SR = new PerlACE::Process($MessengerServer, $o);
+ $SR->Spawn();
+
+ sleep(1);
+
+ #print "Start $MessengerClient \n";
+ $CL = new PerlACE::Process($MessengerClient, "-ORBDefaultInitRef iiop://$TARGETHOSTNAME:$def_port");
+ $test_number++;
+
+ if ($CL->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $SR->Kill();
+ $NS->Kill();
+ exit 1;
+ }
+
+ print "======================================\n";
+ print "Finish Test $test_number: $servers_comments[$test_number] \n";
+ print " $MessengerServer $o\n";
+ print "======================================\n\n";
+
+ $SR->Kill(1);
+}
+
+
+#print "Start $MessengerServer \n";
+$SR = new PerlACE::Process($MessengerServer, "-ORBDefaultInitRef iiop://$TARGETHOSTNAME:$def_port");
+$SR->Spawn();
+
+sleep(1);
+
+$i = 0;
+foreach $o (@corbaloc_clients) {
+
+ # Run the client for each test.
+ #print "Start $MessengerClient $o \n";
+ $CL = new PerlACE::Process($MessengerClient, $o);
+
+
+ if ($CL->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $SR->Kill();
+ $NS->Kill();
+ exit 1;
+ }
+
+ $test_number++;
+ print "======================================\n";
+ print "Finish Test $test_number: $clients_comments[$i]\n";
+ print " $MessengerClient $o";
+ print "\n======================================\n\n";
+
+ $i ++;
+}
+
+
+# clean up
+
+$SR->Kill();
+$NS->Kill();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger.idl b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerClient.cpp b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerClient.cpp
new file mode 100644
index 00000000000..f8166069f8e
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerClient.cpp
@@ -0,0 +1,42 @@
+
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ const char *url = "corbaname:rir:#example/Messenger"; // default URL to InitRef
+ if ( argc < 2 ) {
+ std::cout << "Defaulting URL to " << url << std::endl;
+ std::cout << "Usage: " << argv[0]
+ << " [-ORB options] [corbaname URL for message server]" << std::endl;
+ }
+ else {
+ url = argv[1];
+ }
+
+ // Find the Naming Service & the Message Server name in it
+ CORBA::Object_var obj = orb->string_to_object(url);
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ std::cout << "Message was sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "client:Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..57c577ecedd
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/MessengerServer.cpp
@@ -0,0 +1,62 @@
+
+#include "Messenger_i.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Find the Naming Service
+ obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow(obj.in());
+ if (CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Bind the example Naming Context, if necessary
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup("example");
+ try {
+ CORBA::Object_var dummy = root->resolve(name);
+ }
+ catch(const CosNaming::NamingContext::NotFound&) {
+ CosNaming::NamingContext_var dummy = root->bind_new_context( name );
+ }
+
+ // Bind the Messenger object
+ name.length( 2 );
+ name[1].id = CORBA::string_dup("Messenger");
+
+ // Create an object
+ Messenger_i servant;
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ root->rebind(name, messenger.in());
+
+ std::cout << "Messenger object bound in Naming Service" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "server:Caught a CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..fd6a487bd02
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.cpp
@@ -0,0 +1,33 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.h b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.h
new file mode 100644
index 00000000000..0a3c9f1a2e8
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/Messenger_i.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/README b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/README
new file mode 100644
index 00000000000..c6cd18edbbc
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/README
@@ -0,0 +1,64 @@
+
+DevGuideExamples/NamingService/corbaname_Messenger/README
+
+The example in this directory extends the example in GettingStartedUNIX
+(or GettingStartedVC) to use the Naming_Service
+and calling string_to_object instead of calling resolve_initial_references
+to get the NameService object reference and look up the service in the Naming_Service.
+
+This example only differs from the NamingService/Messenger example by a few lines
+in the MessengerClient.cpp. (All other source files should be the same.)
+
+How to Run:
+-----------
+To start the Naming_Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service &
+
+To start the server:
+------------------
+./MessengerServer
+
+To start the client:
+------------------
+./MessengerClient
+
+
+This MessengerClient will optionally take parameter that is a URL (corbaname:)
+that addresses the Naming_Service and the MessengerServer within it.
+
+The MessengerServer and MessengerClient may also take an -ORBInitRef option
+to help qualify the address of the Naming_Service.
+
+Here are some examples:
+
+REM start the name server
+cd/d %TAO_ROOT%\orbsvcs\Naming_Service
+title NS
+Naming_Service -ORBEndpoint iiop://localhost:2809 -m 0
+
+REM start the example server
+cd/d %EXAMPLES%\NamingService\corbaname_Messenger\Debug
+title server
+REM use -ORBInitRef with IIOP
+MessengerServer -ORBInitRef NameService=iiop://localhost:2809/NameService
+
+
+
+REM start the client
+cd/d %EXAMPLES%\NamingService\corbaname_Messenger\Debug
+title client
+
+REM use a corbaname that does not require -ORBDefaultInitRef
+MessengerClient corbaname:iiop:localhost:2809#example/Messenger
+
+REM defaults to iiop protocol
+MessengerClient corbaname::localhost:2809#example/Messenger
+
+REM default protocol (iiop) and default port (2809)
+MessengerClient corbaname::localhost#example/Messenger
+
+
+
+REM use RIR
+MessengerClient -ORBInitRef NameService=iiop://localhost:2809/NameService corbaname:rir:#example/Messenger
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/corbaname_Messenger.mpc b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/corbaname_Messenger.mpc
new file mode 100644
index 00000000000..06588cc5311
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/corbaname_Messenger.mpc
@@ -0,0 +1,13 @@
+project(*Server): namingexe, naming_skel {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): namingexe {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl
new file mode 100644
index 00000000000..4f903b76aea
--- /dev/null
+++ b/TAO/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl
@@ -0,0 +1,70 @@
+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;
+
+
+$TARGETHOSTNAME = "localhost";
+$def_port = 2809;
+$nsior = "ns.ior";
+
+# start Naming Service
+unlink($nsior);
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-ORBEndpoint iiop://$TARGETHOSTNAME:$def_port -o $nsior");
+$NS->Spawn();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$nsior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+# start the server
+print "Start Messenger Server \n";
+$SR = new PerlACE::Process("MessengerServer",
+ "-ORBInitRef NameService=iiop://$TARGETHOSTNAME:$def_port/NameService");
+$SR->Spawn();
+sleep(2);
+
+
+@corbaname_clients = ("corbaname:iiop:$TARGETHOSTNAME:2809#example/Messenger",
+ "corbaname::$TARGETHOSTNAME:2809#example/Messenger",
+ "corbaname::$TARGETHOSTNAME#example/Messenger",
+ "-ORBInitRef NameService=iiop://$TARGETHOSTNAME:2809/NameService corbaname:rir:#example/Messenger");
+
+@clients_comments = ( "Using a corbaname that does not require -ORBDefaultInitRef: \n",
+ "Using defaults to iiop protocol: \n",
+ "Using default protocol (iiop) and default port ($def_port): \n",
+ "Using Resolve Initial Reference form(must tell ORB where NS is located with -ORBInitRef)\n");
+
+# Run the client for each of the corbaname test.
+$test_number = 0;
+foreach $o (@corbaname_clients) {
+
+ $CL = new PerlACE::Process("MessengerClient", $o);
+
+ if ($CL->SpawnWaitKill(15) != 0) {
+ print STDERR "ERROR: client failed\n";
+ $SR->Kill();
+ $NS->Kill();
+ exit 1;
+ }
+
+ $test_number++;
+
+ print "======================================\n";
+ print "Finish Test $test_number: $clients_comments[$test_number]\n";
+ print " $CL_NAME $o\n";
+ print "======================================\n\n";
+
+}
+
+# clean up
+$SR->Kill ();
+$NS->Kill ();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequence.mpc b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequence.mpc
new file mode 100644
index 00000000000..601d07f9c13
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequence.mpc
@@ -0,0 +1,24 @@
+project(*Server): portableserver, orbsvcsexe, notification_skel, naming {
+ Source_Files {
+ EventSequenceSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): orbsvcsexe, notification, naming {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): portableserver, orbsvcsexe, notification_skel, naming {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ EventSequenceConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.cpp
new file mode 100644
index 00000000000..d64c99f503e
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.cpp
@@ -0,0 +1,50 @@
+#include "EventSequenceConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+EventSequenceConsumer_i::EventSequenceConsumer_i(CORBA::ORB_ptr orb)
+: orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+EventSequenceConsumer_i::push_structured_events (
+ const CosNotification::EventBatch& events
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+{
+
+ std::cout << "events received " << std::endl;
+
+ const char* value = 0;
+
+ for (unsigned int n = 0; n < events.length(); ++n) {
+ for (unsigned int i = 0; i < events[n].filterable_data.length(); ++i) {
+ events[n].filterable_data[i].value >>= value;
+ std::cout << events[n].filterable_data[i].name.in() << "\t" << value << std::endl;
+ }
+ }
+}
+
+void
+EventSequenceConsumer_i::disconnect_sequence_push_consumer ()
+throw(CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+
+}
+
+void
+EventSequenceConsumer_i::offer_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.h b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.h
new file mode 100644
index 00000000000..4ebd891c034
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceConsumer_i.h
@@ -0,0 +1,28 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class EventSequenceConsumer_i : public POA_CosNotifyComm::SequencePushConsumer
+{
+public:
+ EventSequenceConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & events
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_sequence_push_consumer ()
+ throw(CORBA::SystemException);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.cpp
new file mode 100644
index 00000000000..10289d3c1f4
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.cpp
@@ -0,0 +1,31 @@
+#include "EventSequenceSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+EventSequenceSupplier_i::EventSequenceSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+EventSequenceSupplier_i::disconnect_sequence_push_supplier ()
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+EventSequenceSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.h b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.h
new file mode 100644
index 00000000000..fd4c472d9e7
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/EventSequenceSupplier_i.h
@@ -0,0 +1,23 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class EventSequenceSupplier_i : public POA_CosNotifyComm::SequencePushSupplier
+{
+public:
+ // Constructor
+ EventSequenceSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_sequence_push_supplier ()
+ throw(CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger.idl b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger.idl
new file mode 100644
index 00000000000..54ab8dac3e0
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger.idl
@@ -0,0 +1,7 @@
+// messenger.idl
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerClient.cpp
new file mode 100644
index 00000000000..d2937e5d3f1
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerClient.cpp
@@ -0,0 +1,39 @@
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object("file://Messenger.ior");
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message =
+ CORBA::string_dup("Where can I get TAO?");
+
+ messenger->send_message (
+ "person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerConsumer.cpp
new file mode 100644
index 00000000000..35d5b2817ba
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerConsumer.cpp
@@ -0,0 +1,86 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "EventSequenceConsumer_i.h"
+#include <iostream>
+
+int
+main(int argc, char *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+
+ CosNaming::NamingContextExt_var naming_context =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+
+ obj = naming_context->resolve_str("MyEventChannel");
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(obj.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ obj = orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (obj.in());
+
+ EventSequenceConsumer_i servant(orb.in());
+
+ PortableServer::ObjectId_var objectId = poa->activate_object(&servant);
+
+ obj = poa->id_to_reference (objectId.in());
+ CosNotifyComm::SequencePushConsumer_var consumer =
+ CosNotifyComm::SequencePushConsumer::_narrow(obj.in());
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ consumeradmin_proxy_id);
+
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier_var supplier_proxy =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow(proxy_supplier.in());
+
+ supplier_proxy->connect_sequence_push_consumer(consumer.in());
+
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ supplier_proxy->subscription_change(added, removed);
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+
+ poa_manager->activate();
+
+ orb->run();
+
+ orb->destroy();
+
+ return 0;
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ }
+ return 1;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerServer.cpp
new file mode 100644
index 00000000000..a950d7522e3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/MessengerServer.cpp
@@ -0,0 +1,51 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContextExt_var rootNC =
+ CosNaming::NamingContextExt::_narrow(obj.in());
+
+ obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ Messenger_i messenger_servant (orb.in());
+ PortableServer::ObjectId_var oid = poa->activate_object (&messenger_servant);
+ obj = poa->id_to_reference(oid.in());
+ CORBA::String_var str = orb->object_to_string (obj.in());
+
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << " Caught Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+
+}
+
+
+
+
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.cpp
new file mode 100644
index 00000000000..dfc5aecead6
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.cpp
@@ -0,0 +1,125 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "Messenger_i.h"
+#include "EventSequenceSupplier_i.h"
+
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+: orb_ (CORBA::ORB::_duplicate (orb))
+, supplier_(new EventSequenceSupplier_i(orb))
+{
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContextExt_var naming_context =
+ CosNaming::NamingContextExt::_narrow (naming_obj.in());
+
+ CORBA::Object_var obj = naming_context->resolve_str("NotifyEventChannelFactory");
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in ());
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ CosNaming::Name_var name = naming_context->to_name("MyEventChannel");
+ naming_context->rebind(name.in(), ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ supplieradmin_proxy_id);
+
+ CORBA::Object_var poa_obj = orb_->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (poa_obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate ();
+
+ PortableServer::ObjectId_var objectId = poa->activate_object(supplier_.get());
+ CORBA::Object_var supplier_obj = poa->id_to_reference(objectId.in());
+
+ CosNotifyComm::SequencePushSupplier_var supplier =
+ CosNotifyComm::SequencePushSupplier::_narrow(supplier_obj.in());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushConsumer::_narrow(proxy_consumer.in());
+
+ consumer_proxy_->connect_sequence_push_supplier(supplier.in());
+}
+
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException)
+{
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ std::cout << "pushing " << std::endl;
+ CosNotification::EventBatch events;
+ events.length(4);
+ events[0] = event;
+ events[1] = event;
+ events[2] = event;
+ events[3] = event;
+
+ consumer_proxy_->push_structured_events(events);
+
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.h
new file mode 100644
index 00000000000..ca025474fb0
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/Messenger_i.h
@@ -0,0 +1,36 @@
+#ifndef MESSENGER_H_
+#define MESSENGER_H_
+
+#include "MessengerS.h"
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <ace/Auto_Ptr.h>
+
+class EventSequenceSupplier_i;
+
+class Messenger_i : public POA_Messenger
+{
+ public:
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::SequenceProxyPushConsumer_var consumer_proxy_;
+ auto_ptr<EventSequenceSupplier_i> supplier_;
+};
+
+#endif
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/README b/TAO/DevGuideExamples/NotifyService/EventSequence/README
new file mode 100644
index 00000000000..d33d422278b
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/README
@@ -0,0 +1,63 @@
+Event Notification Service
+
+
+File: examples/NotifyService/EventSequence/README
+
+This directory contains an example which transmits an EventBatch using the Notification Service.
+
+This example extends the Messenger example in GettingStarted directory
+to illustrate how the Notification channel can be used to push event batches
+from the supplier to the consumer. The example uses the push/push model.
+
+The MessengerServer in this example plays the role of a server for
+the MessengerClient and the role of a supplier for the MessengerConsumer.
+The flow of messages is shown below:
+
+MessengerClient->MessengerSupplier->NotificationChannel->MessengerConsumer.
+
+
+The Client code is stored in:
+
+examples/NotifyService/EventSequence/MessengerClient.cpp
+
+The Server code is stored in:
+
+examples/NotifyService/EventSequence/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+examples/NotifyService/EventSequence/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.ior&
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/EventSequence/run_test.pl b/TAO/DevGuideExamples/NotifyService/EventSequence/run_test.pl
new file mode 100644
index 00000000000..540c676a957
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/EventSequence/run_test.pl
@@ -0,0 +1,75 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService, "$arg_ns_ref -IORoutput $notify_ior");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/Filtering.mpc b/TAO/DevGuideExamples/NotifyService/Filtering/Filtering.mpc
new file mode 100644
index 00000000000..823b95838b1
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/Filtering.mpc
@@ -0,0 +1,27 @@
+project(*Server): portableserver, orbsvcsexe, notification_skel, naming {
+ exename = MessengerServer
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): orbsvcsexe, notification, naming {
+ exename = MessengerClient
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): portableserver, orbsvcsexe, notification_skel, naming {
+ exename = MessengerConsumer
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/Messenger.idl b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerClient.cpp
new file mode 100644
index 00000000000..d82568ac816
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerClient.cpp
@@ -0,0 +1,61 @@
+#include <orbsvcs/CosNamingC.h>
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var rootObj =
+ orb->resolve_initial_references("NameService");
+
+ CosNaming::NamingContext_var rootContext =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("MessengerService");
+
+ CORBA::Object_var messengerObj = rootContext->resolve(name);
+
+ if (CORBA::is_nil(messengerObj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(messengerObj.in());
+ if (CORBA::is_nil(messenger.in ())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup(
+ "We are experiencing network problems.");
+ messenger->send_message ("sysadmin@company.com",
+ "urgent",
+ message.inout());
+
+ message = CORBA::string_dup("Where can I get TAO?");
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+
+ message = CORBA::string_dup(
+ "Please contact sales@company.com regarding your request.");
+ messenger->send_message ("sysadmin@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ std::cout << "MessengerClient: success" << std::endl;
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerConsumer.cpp
new file mode 100644
index 00000000000..30b708ced6f
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerConsumer.cpp
@@ -0,0 +1,156 @@
+#include <ace/Get_Opt.h>
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "StructuredEventConsumer_i.h"
+#include <iostream>
+
+#define CA_FILTER "($.From == 'sysadmin@company.com') and ($.Subject == 'urgent') "
+#define TCL_GRAMMAR "EXTENDED_TCL"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ return 1;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name(1);
+ name.length (1);
+ name[0].id = CORBA::string_dup("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow(obj.in());
+
+ if (CORBA::is_nil(notify_factory.in())) {
+ std::cerr << "Unable to find notify factory" << std::endl;
+ return 1;
+ }
+
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to find event channel" << std::endl;
+ return 1;
+ }
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::AND_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ if (CORBA::is_nil (consumer_admin.in())) {
+ std::cerr << "Unable to find consumer admin" << std::endl;
+ return 1;
+ }
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory ();
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var ca_filter =
+ ffact->create_filter (TCL_GRAMMAR);
+
+ if (CORBA::is_nil (ca_filter.in())) {
+ std::cerr << "Unable to create filetr object" << std::endl;
+ return 1;
+ }
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (CA_FILTER);
+
+ ca_filter->add_constraints (constraint_list);
+
+ consumer_admin ->add_filter (ca_filter.in());
+
+ CosNotification::EventTypeSeq added(1);
+ CosNotification::EventTypeSeq removed (0);
+ added.length (1);
+ removed.length (0);
+
+ added[0].domain_name = CORBA::string_dup ("*");
+ added[0].type_name = CORBA::string_dup ("*");
+
+ consumer_admin->subscription_change (added, removed);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in())) {
+ std::cerr << "Unable to initialize the POA." << std::endl;
+ return 1;
+ }
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow(poa_object.in());
+
+ StructuredEventConsumer_i servant(orb.in());
+ /*
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ servant._this();
+ */
+
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ CosNotifyComm::StructuredPushConsumer::_narrow(consumer_obj.in());
+
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+
+ // The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy = CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow(proxy_supplier.in());
+
+ if (CORBA::is_nil (supplier_proxy.in())) {
+ std::cerr << "Unable to create structured push supplier proxy" << std::endl;
+ return 1;
+ }
+
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+
+ poa_manager->activate();
+
+ orb->run();
+ orb->destroy ();
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerServer.cpp
new file mode 100644
index 00000000000..1e7b90c8408
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/MessengerServer.cpp
@@ -0,0 +1,94 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <ace/Argv_Type_Converter.h>
+#include <ace/Get_Opt.h>
+#include <iostream>
+#include <fstream>
+
+ACE_TString ior_output_file;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ case '?':
+ default:
+ std::cerr << "usage: " << argv[0] << " -o <ior>" << std::endl;
+ return -1;
+ break;
+ }
+ return 0;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR* argv[])
+{
+ try
+ {
+ // Initialize orb
+ ACE_Argv_Type_Converter conv(argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init(conv.get_argc(),
+ conv.get_TCHAR_argv());
+
+ if (parse_args(argc, argv) != 0) {
+ return 1;
+ }
+
+ // Find the Naming Service.
+ CORBA::Object_var rootObj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ // Get the 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();
+
+ // Create our Messenger servant.
+ Messenger_i messenger_servant(orb.in());
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ // Generating the ior file is just for the purpose of synchronize the
+ // the startup of the server and consumer.
+ CORBA::String_var ior = orb->object_to_string(messenger_obj.in());
+ if (ior_output_file != ACE_TEXT("")) {
+ std::ofstream outfile(ACE_TEXT_ALWAYS_CHAR(ior_output_file.c_str()));
+ outfile << ior.in();
+ }
+
+ // Bind it in the Naming Service.
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MessengerService");
+ rootNC->rebind(name, messenger_obj.in());
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.cpp
new file mode 100644
index 00000000000..9e5373e9c4c
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.cpp
@@ -0,0 +1,161 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate(orb))
+
+{
+ try
+ {
+ CORBA::Object_var poa_obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(poa_obj.in());
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name(1);
+ name.length (1);
+ name[0].id = CORBA::string_dup("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow(obj.in());
+
+ if (CORBA::is_nil(notify_factory.in())) {
+ std::cerr << "Unable to find notify factory" << std::endl;
+ }
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to crete event channel" << std::endl;
+ }
+
+ name.length(1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+
+ naming_context->rebind(name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::AND_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ if (CORBA::is_nil (supplier_admin.in())) {
+ std::cerr << "Unable to find supplier admin" << std::endl;
+ }
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ PortableServer::ObjectId_var oid = poa->activate_object(servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ CosNotifyComm::StructuredPushSupplier::_narrow(supplier_obj.in());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::
+ _narrow(proxy_consumer.in());
+
+ if (CORBA::is_nil (consumer_proxy_.in())) {
+ std::cerr << "Unable to find structured proxy push consumer" << std::endl;
+ }
+
+ consumer_proxy_->connect_structured_push_supplier(supplier.in());
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ }
+
+}
+
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException)
+{
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+ try
+ {
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("From");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ consumer_proxy_->push_structured_event(event);
+ }
+
+ catch(const CosNotifyComm::InvalidEventType&) {
+ std::cerr << "Invalid Event Type Exception " << std::endl;
+ return 1;
+ }
+
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.h
new file mode 100644
index 00000000000..2353918a2e9
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/Messenger_i.h
@@ -0,0 +1,34 @@
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "MessengerS.h"
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy_;
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/README b/TAO/DevGuideExamples/NotifyService/Filtering/README
new file mode 100644
index 00000000000..6f140bc5a86
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/README
@@ -0,0 +1,62 @@
+Event Notification Service
+
+
+File: DevGuideExamples/NotifyService/Filtering/README
+
+
+This example extends the NotifyService/Messenger example by
+demonstrating how filtering can be incorporated into the utilization
+of the Notification channel. Supplier-side, and consumer-side
+filtering can be implemented, but only consumer_side filtering is
+demonstrated in this example.
+
+Filters are configured to guarantee that only certain events are
+passed to the consumer. The criteria is specified by imposing constraints
+on the appropriate fields of a structured event.
+
+
+The Client code is stored in:
+
+DevGuideExamples/NotifyService/Filtering/MessengerClient.cpp
+
+The Server code is stored in:
+
+DevGuideExamples/NotifyService/Filtering/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+DevGuideExamples/NotifyService/Filtering/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.ior&
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..923dbfd6dcd
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.cpp
@@ -0,0 +1,53 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event
+ )
+ throw (CORBA::SystemException,
+ CosEventComm::Disconnected)
+{
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name << "\t" <<value<< std::endl;
+ }
+
+ std::cerr << "MessengerConsumer: success" << std::endl;
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer(
+ )
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType)
+
+{
+ //Noop
+}
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..9debf6c7d31
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventConsumer_i.h
@@ -0,0 +1,33 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventConsumer_i :
+ public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ )
+ throw (CORBA::SystemException,
+ CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_structured_push_consumer(
+ )
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..6c505c369ba
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.cpp
@@ -0,0 +1,33 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier (
+ )
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..deb2df7d625
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/StructuredEventSupplier_i.h
@@ -0,0 +1,28 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventSupplier_i :
+ public virtual POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier (
+ )
+ throw (CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/Filtering/run_test.pl b/TAO/DevGuideExamples/NotifyService/Filtering/run_test.pl
new file mode 100644
index 00000000000..388e3d44d81
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Filtering/run_test.pl
@@ -0,0 +1,75 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService, "$arg_ns_ref -IORoutput $notify_ior");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", "$arg_ns_ref -o $messiorfile");
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.idl b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.mpc b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.mpc
new file mode 100644
index 00000000000..3329ee1c1ee
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, namingexe, notification_skel {
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, notification {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): taoexe, portableserver, namingexe, notification_skel {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerClient.cpp
new file mode 100644
index 00000000000..10e659ab20f
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerClient.cpp
@@ -0,0 +1,39 @@
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup(
+ "Where can I get TAO?");
+ for (int i=0; i<3; i++) {
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+ }
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerConsumer.cpp
new file mode 100644
index 00000000000..63dd7df2c85
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerConsumer.cpp
@@ -0,0 +1,101 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "StructuredEventConsumer_i.h"
+#include <iostream>
+
+int
+main(int argc, char *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_object.in());
+
+ StructuredEventConsumer_i servant (orb.in());
+
+ PortableServer::ObjectId_var objectId = poa->activate_object (&servant);
+
+ CORBA::Object_var consumer_obj = poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ CosNotifyComm::StructuredPushConsumer::_narrow (consumer_obj.in ());
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy = CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow(proxy_supplier.in());
+
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+
+
+
+
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ supplier_proxy->subscription_change(added, removed);
+
+
+
+
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+
+ poa_manager->activate();
+
+ orb->run();
+
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..7d4127d6b92
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/MessengerServer.cpp
@@ -0,0 +1,48 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ Messenger_i messenger_servant (orb.in ());
+ PortableServer::ObjectId_var oid = poa->activate_object (&messenger_servant);
+ CORBA::Object_var messenger_obj = poa->id_to_reference (oid.in ());
+ CORBA::String_var str = orb->object_to_string (messenger_obj.in());
+
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in () << std::endl;
+ iorFile.close ();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ orb->run ();
+ orb->destroy ();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+
+}
+
+
+
+
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..8b5557efcde
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.cpp
@@ -0,0 +1,127 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+#include <ace/OS_NS_stdio.h>
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve (name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in ());
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ name[0].id = CORBA::string_dup ("MyEventChannel");
+
+ naming_context->rebind (name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ CORBA::Object_var poa_obj = orb_->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (poa_obj.in ());
+ PortableServer::POAManager_var mgr = poa->the_POAManager ();
+
+ mgr->activate ();
+ PortableServer::ObjectId_var objectId = poa->activate_object (servant);
+
+ CORBA::Object_var supplier_obj = poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ CosNotifyComm::StructuredPushSupplier::_narrow (supplier_obj.in ());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow (proxy_consumer.in());
+
+ consumer_proxy_->
+ connect_structured_push_supplier (supplier.in());
+}
+
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException)
+{
+
+ ACE_OS::printf("Message from: %s\nSubject: %s\nMessage: %s\n",
+ user_name, subject, message);
+ //cout << "Message from: " << user_name << endl;
+ //cout << "Subject: " << subject << endl;
+ //cout << "Message: " << message << endl;
+
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ std::cout << "pushing " << std::endl;
+ consumer_proxy_->push_structured_event(event);
+
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.h
new file mode 100644
index 00000000000..6fffc18cbf4
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/Messenger_i.h
@@ -0,0 +1,29 @@
+#ifndef MESSENGER_H_
+#define MESSENGER_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include "MessengerS.h"
+
+class Messenger_i : public POA_Messenger
+{
+ public:
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy_;
+};
+
+#endif
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/README b/TAO/DevGuideExamples/NotifyService/Messenger/README
new file mode 100644
index 00000000000..350316f40c3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/README
@@ -0,0 +1,64 @@
+Event Notification Service
+
+
+File: examples/NotifyService/Messenger/README
+
+This directory contains a simple example of using the Notification Service.
+
+This example extends the Messenger example in GettingStarted directory
+to illustrate how the Notification channel can be used to push messages
+from the supplier to the consumer. Structured events are used to demonstrate
+the operation of the channel. The example uses the push/push model.
+
+The MessengerServer in this example plays the role of a server for
+the MessengerClient and the role of a supplier for the MessengerConsumer.
+The flow of messages is shown below:
+
+MessengerClient->MessengerSupplier->NotificationChannel->MessengerConsumer.
+
+
+The Client code is stored in:
+
+examples/NotifyService/Messenger/MessengerClient.cpp
+
+The Server code is stored in:
+
+examples/NotifyService/Messenger/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+examples/NotifyService/Messenger/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.ior&
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..ae1208c30d3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.cpp
@@ -0,0 +1,50 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+
+{
+
+ std::cout << "event received " << std::endl;
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
+ }
+
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer()
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..be60942df06
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventConsumer_i.h
@@ -0,0 +1,31 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyCommS.h>
+
+class StructuredEventConsumer_i :
+ public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_structured_push_consumer()
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..91139284edd
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.cpp
@@ -0,0 +1,31 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier ()
+ throw(CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..1b5b5dc7250
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/StructuredEventSupplier_i.h
@@ -0,0 +1,24 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyCommS.h>
+
+class StructuredEventSupplier_i :
+ public virtual POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier ()
+ throw(CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/Messenger/run_test.pl b/TAO/DevGuideExamples/NotifyService/Messenger/run_test.pl
new file mode 100644
index 00000000000..540c676a957
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/Messenger/run_test.pl
@@ -0,0 +1,75 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService, "$arg_ns_ref -IORoutput $notify_ior");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger.idl b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerClient.cpp
new file mode 100644
index 00000000000..f7e029ac598
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerClient.cpp
@@ -0,0 +1,52 @@
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var rootObj =
+ orb->resolve_initial_references("NameService");
+
+ CosNaming::NamingContext_var rootContext =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("MessengerService");
+
+ CORBA::Object_var messengerObj = rootContext->resolve(name);
+
+ Messenger_var messenger = Messenger::_narrow(messengerObj.in());
+
+ if (CORBA::is_nil(messenger.in ())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ }
+
+ CORBA::String_var message = CORBA::string_dup("Where can I get TAO?");
+
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ std::cout << "MessengerClient: success" << std::endl;
+ return 0;
+
+}
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerConsumer.cpp
new file mode 100644
index 00000000000..f5f9f0e6aa8
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerConsumer.cpp
@@ -0,0 +1,116 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "StructuredEventConsumer_i.h"
+#include <iostream>
+
+int
+main(int argc, char *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in())) {
+ std::cerr << "Unable to initialize the POA." << std::endl;
+ return 1;
+ }
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow(poa_object.in());
+
+ // Activate POA manager
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ return 1;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name(1);
+
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to find event channel" << std::endl;
+ return 1;
+ }
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ if (CORBA::is_nil (consumer_admin.in())) {
+ std::cerr << "Unable to find consumer admin" << std::endl;
+ return 1;
+ }
+
+ StructuredEventConsumer_i servant(orb.in());
+
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ servant._this();
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+ // The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy = CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow(proxy_supplier.in());
+
+ if (CORBA::is_nil (supplier_proxy.in())) {
+ std::cerr << "Unable to create structured push supplier proxy" << std::endl;
+ return 1;
+ }
+
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ supplier_proxy->subscription_change(added, removed);
+
+ orb->run();
+
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "MessengerConsumer:: Caught exception: " << ex << std::endl;
+ return 1;
+ }
+ std::cerr << "MessengerConsumer: success" << std::endl;
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerServer.cpp
new file mode 100644
index 00000000000..b3467a4e945
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/MessengerServer.cpp
@@ -0,0 +1,63 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var rootObj = orb->resolve_initial_references("NameService");
+
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ // 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();
+
+ // Create an object
+ Messenger_i messenger_servant(orb.in());
+
+ Messenger_var messenger = messenger_servant._this();
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MessengerService");
+
+ rootNC->rebind(name, messenger.in());
+
+ CORBA::String_var str = orb->object_to_string (messenger.in());
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in () << std::endl;
+ iorFile.close ();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ // Accept requests
+ orb->run();
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "MessengerServer::Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.cpp
new file mode 100644
index 00000000000..d41222adcdc
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.cpp
@@ -0,0 +1,163 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+
+ CORBA::Object_var poa_object =
+ orb_->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in())) {
+ std::cerr << "Unable to initialize the POA." << std::endl;
+ }
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow(obj.in());
+
+ if (CORBA::is_nil(notify_factory.in())) {
+ std::cerr << "Unable to find notify factory" << std::endl;
+ }
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to crete event channel" << std::endl;
+ }
+
+ // name.length(1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+
+ naming_context->rebind(name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ if (CORBA::is_nil (supplier_admin.in())) {
+ std::cerr << "Unable to find supplier admin" << std::endl;
+ }
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ servant->_this();
+
+ s_proxy_consumer_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::
+ _narrow(proxy_consumer.in());
+
+ if (CORBA::is_nil (s_proxy_consumer_.in())) {
+ std::cerr << "Unable to find structured proxy push consumer" << std::endl;
+ }
+
+ s_proxy_consumer_->
+ connect_structured_push_supplier(supplier.in());
+
+
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ s_proxy_consumer_->offer_change(added, removed);
+
+}
+
+
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+
+ throw (CORBA::SystemException)
+
+{
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ s_proxy_consumer_->push_structured_event(event);
+
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.h
new file mode 100644
index 00000000000..2e6cabb4b3b
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/Messenger_i.h
@@ -0,0 +1,30 @@
+#ifndef MESSENGER_H_
+#define MESSENGER_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include "MessengerS.h"
+
+class Messenger_i : public POA_Messenger
+{
+public:
+ Messenger_i (CORBA::ORB_ptr orb);
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var s_proxy_consumer_;
+};
+
+#endif
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/OfferSubscriptions.mpc b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/OfferSubscriptions.mpc
new file mode 100644
index 00000000000..3329ee1c1ee
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/OfferSubscriptions.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, namingexe, notification_skel {
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, notification {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): taoexe, portableserver, namingexe, notification_skel {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/README b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/README
new file mode 100644
index 00000000000..a4e60f8ca9b
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/README
@@ -0,0 +1,66 @@
+Event Notification Service
+
+
+File: examples/NotifyService/OfferSubscriptions/README
+
+
+This example extends the NotifyService/Messenger example by incorporating
+"offers" and "subscriptions" into the utilization of the Notification
+channel.
+
+The publication of "offers" by a supplier, informs consumers of the
+Notification channel about the types of events it will be producing. This
+is accomplished via the 'offer_change()' operation.
+
+Moreover, the example demonstrates how consumers can inform Notification
+channel suppliers about the types of events in which they are interested.
+The set of events in which a consumer is interested is called a "subscription"
+and can be communicated via the 'subscription_change()' operation.
+
+
+
+The Client code is stored in:
+
+examples/NotifyService/OfferSubscriptions/MessengerClient.cpp
+
+The Server code is stored in:
+
+examples/NotifyService/OfferSubscriptions/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+examples/NotifyService/OfferSubscriptions/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.ior&
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..61b436fbf8c
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.cpp
@@ -0,0 +1,49 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+
+{
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name << "\t" <<value<< std::endl;
+ }
+
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer(
+ )
+ throw(CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..9fd15085011
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventConsumer_i.h
@@ -0,0 +1,29 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventConsumer_i : public POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_structured_push_consumer(
+ )
+ throw(CORBA::SystemException);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..6160191438a
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.cpp
@@ -0,0 +1,31 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier ()
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..be820a45533
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/StructuredEventSupplier_i.h
@@ -0,0 +1,23 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventSupplier_i : public POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier ()
+ throw (CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw(CORBA::SystemException, CosNotifyComm::InvalidEventType);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/run_test.pl b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/run_test.pl
new file mode 100644
index 00000000000..540c676a957
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/OfferSubscriptions/run_test.pl
@@ -0,0 +1,75 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService, "$arg_ns_ref -IORoutput $notify_ior");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger.idl b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerClient.cpp
new file mode 100644
index 00000000000..be4780fa3b6
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerClient.cpp
@@ -0,0 +1,40 @@
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup(
+ "Where can I get TAO?");
+ for (int i=0; i<3; i++) {
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+ }
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerConsumer.cpp
new file mode 100644
index 00000000000..5dceba9caa9
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerConsumer.cpp
@@ -0,0 +1,100 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "StructuredEventConsumer_i.h"
+#include <iostream>
+
+int
+main(int argc, char *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop, adminid);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_object.in());
+
+ StructuredEventConsumer_i servant (orb.in());
+
+ PortableServer::ObjectId_var objectId = poa->activate_object (&servant);
+
+ CORBA::Object_var consumer_obj = poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ CosNotifyComm::StructuredPushConsumer::_narrow (consumer_obj.in ());
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow(proxy_supplier.in());
+
+ CosNotification::QoSProperties properties (1);
+
+ properties.length (1);
+ properties[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ properties[0].value <<= CosNotification::FifoOrder;
+
+ supplier_proxy->set_qos (properties);
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ supplier_proxy->subscription_change(added, removed);
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+
+ poa_manager->activate();
+
+ orb->run();
+
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerServer.cpp
new file mode 100644
index 00000000000..3719c25cc60
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/MessengerServer.cpp
@@ -0,0 +1,46 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+#include <fstream>
+
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var rootObj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ Messenger_i messenger_servant (orb.in ());
+ PortableServer::ObjectId_var oid = poa->activate_object (&messenger_servant);
+ CORBA::Object_var messenger_obj = poa->id_to_reference (oid.in ());
+ CORBA::String_var str = orb->object_to_string (messenger_obj.in());
+
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in () << std::endl;
+ iorFile.close ();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ orb->run ();
+ orb->destroy ();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.cpp
new file mode 100644
index 00000000000..57591cc06b3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.cpp
@@ -0,0 +1,140 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve (name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in ());
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ initial_admin.length (4);
+
+ initial_admin[0].name = CORBA::string_dup (CosNotification::MaxQueueLength);
+ initial_admin[0].value <<= (CORBA::Long)7;
+
+ initial_admin[1].name = CORBA::string_dup (CosNotification::MaxSuppliers);
+ initial_admin[1].value <<= (CORBA::Long)1;
+
+ initial_admin[2].name = CORBA::string_dup (CosNotification::MaxConsumers);
+ initial_admin[2].value <<= (CORBA::Long)1;
+
+ initial_admin[3].name = CORBA::string_dup (CosNotification::RejectNewEvents);
+ initial_admin[3].value <<= CORBA::Any::from_boolean((CORBA::Boolean)1);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ name[0].id = CORBA::string_dup ("MyEventChannel");
+
+ naming_context->rebind (name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ CORBA::Object_var poa_obj = orb_->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (poa_obj.in ());
+ PortableServer::POAManager_var mgr = poa->the_POAManager ();
+
+ mgr->activate ();
+ PortableServer::ObjectId_var objectId = poa->activate_object (servant);
+
+ CORBA::Object_var supplier_obj = poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ CosNotifyComm::StructuredPushSupplier::_narrow (supplier_obj.in ());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow (proxy_consumer.in());
+
+ consumer_proxy_->
+ connect_structured_push_supplier (supplier.in());
+}
+
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException)
+{
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ std::cout << "pushing " << std::endl;
+ consumer_proxy_->push_structured_event(event);
+
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.h
new file mode 100644
index 00000000000..6fffc18cbf4
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/Messenger_i.h
@@ -0,0 +1,29 @@
+#ifndef MESSENGER_H_
+#define MESSENGER_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include "MessengerS.h"
+
+class Messenger_i : public POA_Messenger
+{
+ public:
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy_;
+};
+
+#endif
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/QoSProperties.mpc b/TAO/DevGuideExamples/NotifyService/QoSProperties/QoSProperties.mpc
new file mode 100644
index 00000000000..3329ee1c1ee
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/QoSProperties.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, namingexe, notification_skel {
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, notification {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): taoexe, portableserver, namingexe, notification_skel {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/README b/TAO/DevGuideExamples/NotifyService/QoSProperties/README
new file mode 100644
index 00000000000..4808cc2b8d6
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/README
@@ -0,0 +1,55 @@
+Event Notification Service
+
+
+File: DevGuideExamples/NotifyService/QoSProperties/README
+
+
+This example extends the NotifyService/Messenger example by
+demonstrating how QoS features can be incorporated into the utilization
+of the Notification channel.
+
+The Client code is stored in:
+
+DevGuideExamples/NotifyService/QoSProperties/MessengerClient.cpp
+
+The Server code is stored in:
+
+DevGuideExamples/NotifyService/QoSProperties/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+DevGuideExamples/NotifyService/QoSProperties/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.ior&
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..90d663a26a7
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.cpp
@@ -0,0 +1,58 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event
+ )
+ throw (
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ )
+
+{
+
+ std::cout << "event received " << std::endl;
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
+ }
+
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer()
+ throw (
+ CORBA::SystemException
+ )
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ )
+{
+}
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..fbbc7fea45c
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventConsumer_i.h
@@ -0,0 +1,38 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventConsumer_i :
+ public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ )
+ throw (
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ );
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ );
+
+ virtual void disconnect_structured_push_consumer()
+ throw (
+ CORBA::SystemException
+ );
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..4cb4289f8c3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.cpp
@@ -0,0 +1,36 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier ()
+ throw (
+ CORBA::SystemException
+ )
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ )
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..58a744775fe
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/StructuredEventSupplier_i.h
@@ -0,0 +1,29 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventSupplier_i :
+ public virtual POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier ()
+ throw (
+ CORBA::SystemException
+ );
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ );
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/QoSProperties/run_test.pl b/TAO/DevGuideExamples/NotifyService/QoSProperties/run_test.pl
new file mode 100644
index 00000000000..540c676a957
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/QoSProperties/run_test.pl
@@ -0,0 +1,75 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService, "$arg_ns_ref -IORoutput $notify_ior");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger.idl b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger.idl
new file mode 100644
index 00000000000..df3027a9c49
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger.idl
@@ -0,0 +1,8 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message(in string user_name,
+ in string subject,
+ inout string message);
+};
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerClient.cpp
new file mode 100644
index 00000000000..10e659ab20f
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerClient.cpp
@@ -0,0 +1,39 @@
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup(
+ "Where can I get TAO?");
+ for (int i=0; i<3; i++) {
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+ }
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerConsumer.cpp
new file mode 100644
index 00000000000..99240cc2844
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerConsumer.cpp
@@ -0,0 +1,183 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+#include "orbsvcs/NotifyExtC.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+#include "StructuredEventConsumer_i.h"
+#include "Priorities.h"
+#include <iostream>
+
+int
+main(int argc, char *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_object.in());
+
+ CORBA::Object_var rtorb_obj = orb->resolve_initial_references ("RTORB");
+ RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (rtorb_obj.in ());
+
+ // Create an RT POA with a lane at the given priority.
+ CORBA::Policy_var priority_model_policy =
+ rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
+ DEFAULT_PRIORITY);
+
+ RTCORBA::ThreadpoolLanes lanes (2);
+ lanes.length (2);
+
+ lanes[0].lane_priority = LOW_PRIORITY;
+ lanes[0].static_threads = 2;
+ lanes[0].dynamic_threads = 0;
+ lanes[1].lane_priority = HIGH_PRIORITY;
+ lanes[1].static_threads = 2;
+ lanes[1].dynamic_threads = 0;
+
+
+ // Create a thread-pool.
+ CORBA::ULong stacksize = 0;
+ CORBA::Boolean allow_request_buffering = 0;
+ CORBA::ULong max_buffered_requests = 0;
+ CORBA::ULong max_request_buffer_size = 0;
+ CORBA::Boolean allow_borrowing = 0;
+
+ // Create the thread-pool.
+ RTCORBA::ThreadpoolId threadpool_id =
+ rt_orb->create_threadpool_with_lanes (stacksize,
+ lanes,
+ allow_borrowing,
+ allow_request_buffering,
+ max_buffered_requests,
+ max_request_buffer_size);
+
+ // Create a thread-pool policy.
+ CORBA::Policy_var lanes_policy =
+ rt_orb->create_threadpool_policy (threadpool_id);
+
+ CORBA::PolicyList poa_policy_list(2);
+ poa_policy_list.length (2);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = lanes_policy;
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager ();
+
+ PortableServer::POA_var rt_poa = poa->create_POA ("RT POA",
+ poa_manager.in (),
+ poa_policy_list);
+
+ StructuredEventConsumer_i servant (orb.in());
+
+ PortableServer::ObjectId_var objectId =
+ rt_poa->activate_object (&servant);
+
+ CORBA::Object_var consumer_obj =
+ rt_poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ CosNotifyComm::StructuredPushConsumer::_narrow (consumer_obj.in ());
+
+ NotifyExt::ThreadPoolLanesParams tpl_params;
+
+ tpl_params.priority_model = NotifyExt::CLIENT_PROPAGATED;
+ tpl_params.server_priority = DEFAULT_PRIORITY;
+ tpl_params.stacksize = 0;
+ tpl_params.allow_borrowing = 0;
+ tpl_params.allow_request_buffering = 0;
+ tpl_params.max_buffered_requests = 0;
+ tpl_params.max_request_buffer_size = 0;
+ tpl_params.lanes.length (2);
+ tpl_params.lanes[0].lane_priority = LOW_PRIORITY;
+ tpl_params.lanes[0].static_threads = 2;
+ tpl_params.lanes[0].dynamic_threads = 0;
+ tpl_params.lanes[1].lane_priority = HIGH_PRIORITY;
+ tpl_params.lanes[1].static_threads = 2;
+ tpl_params.lanes[1].dynamic_threads = 0;
+ CosNotification::QoSProperties qos;
+ qos.length(1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPoolLanes);
+ qos[0].value <<= tpl_params;
+
+ consumer_admin->set_qos(qos);
+ CORBA::Object_var current_obj =
+ orb->resolve_initial_references ("RTCurrent");
+
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow (current_obj.in ());
+ current->the_priority(HIGH_PRIORITY);
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy = CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow(proxy_supplier.in());
+
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+
+
+
+
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed (1);
+ added.length (1);
+ removed.length (1);
+
+ added[0].domain_name = CORBA::string_dup ("OCI_TAO");
+ added[0].type_name = CORBA::string_dup ("examples");
+
+ removed[0].domain_name = CORBA::string_dup ("*");
+ removed[0].type_name = CORBA::string_dup ("*");
+
+ supplier_proxy->subscription_change(added, removed);
+
+
+
+
+
+ poa_manager->activate();
+
+ orb->run();
+
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerServer.cpp
new file mode 100644
index 00000000000..7d4127d6b92
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/MessengerServer.cpp
@@ -0,0 +1,48 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ Messenger_i messenger_servant (orb.in ());
+ PortableServer::ObjectId_var oid = poa->activate_object (&messenger_servant);
+ CORBA::Object_var messenger_obj = poa->id_to_reference (oid.in ());
+ CORBA::String_var str = orb->object_to_string (messenger_obj.in());
+
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in () << std::endl;
+ iorFile.close ();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ orb->run ();
+ orb->destroy ();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+
+}
+
+
+
+
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.cpp
new file mode 100644
index 00000000000..1c9e1e59676
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.cpp
@@ -0,0 +1,157 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+#include "orbsvcs/NotifyExtC.h"
+#include <ace/OS_NS_stdio.h>
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+#include "Priorities.h"
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = naming_context->resolve (name);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in ());
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ name[0].id = CORBA::string_dup ("MyEventChannel");
+
+ naming_context->rebind (name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ NotifyExt::ThreadPoolLanesParams tpl_params;
+
+ tpl_params.priority_model = NotifyExt::CLIENT_PROPAGATED;
+ tpl_params.server_priority = DEFAULT_PRIORITY;
+ tpl_params.stacksize = 0;
+ tpl_params.allow_borrowing = 0;
+ tpl_params.allow_request_buffering = 0;
+ tpl_params.max_buffered_requests = 0;
+ tpl_params.max_request_buffer_size = 0;
+ tpl_params.lanes.length (2);
+ tpl_params.lanes[0].lane_priority = LOW_PRIORITY;
+ tpl_params.lanes[0].static_threads = 2;
+ tpl_params.lanes[0].dynamic_threads = 0;
+ tpl_params.lanes[1].lane_priority = HIGH_PRIORITY;
+ tpl_params.lanes[1].static_threads = 2;
+ tpl_params.lanes[1].dynamic_threads = 0;
+ CosNotification::QoSProperties qos;
+ qos.length(1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPoolLanes);
+ qos[0].value <<= tpl_params;
+
+ supplier_admin->set_qos(qos);
+ CORBA::Object_var current_obj =
+ this->orb_->resolve_initial_references ("RTCurrent");
+
+ current_ = RTCORBA::Current::_narrow (current_obj.in ());
+ current_->the_priority(HIGH_PRIORITY);
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ CORBA::Object_var poa_obj = orb_->resolve_initial_references ("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (poa_obj.in ());
+ PortableServer::POAManager_var mgr = poa->the_POAManager ();
+
+ mgr->activate ();
+ PortableServer::ObjectId_var objectId = poa->activate_object (servant);
+
+ CORBA::Object_var supplier_obj = poa->id_to_reference (objectId.in ());
+
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ CosNotifyComm::StructuredPushSupplier::_narrow (supplier_obj.in ());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow (proxy_consumer.in());
+
+ consumer_proxy_->
+ connect_structured_push_supplier (supplier.in());
+}
+
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException)
+{
+ ACE_OS::printf("Message from: %s\nSubject: %s\nMessage: %s\n",
+ user_name, subject, message);
+ //cout << "Message from: " << user_name << endl;
+ //cout << "Subject: " << subject << endl;
+ //cout << "Message: " << message << endl;
+
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ std::cout << "pushing " << std::endl;
+ current_->the_priority(HIGH_PRIORITY);
+ consumer_proxy_->push_structured_event(event);
+
+ return 1;
+
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.h
new file mode 100644
index 00000000000..10ef4594b50
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/Messenger_i.h
@@ -0,0 +1,31 @@
+#ifndef MESSENGER_H_
+#define MESSENGER_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include "MessengerS.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+class Messenger_i : public POA_Messenger
+{
+ public:
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException);
+
+ private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy_;
+ RTCORBA::Current_var current_;
+};
+
+#endif
+
+
+
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/Priorities.h b/TAO/DevGuideExamples/NotifyService/RTNotify/Priorities.h
new file mode 100644
index 00000000000..f181f10aec1
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/Priorities.h
@@ -0,0 +1,8 @@
+#ifndef _PRIORITIES_H_
+#define _PRIORITIES_H_
+
+#define LOW_PRIORITY 0
+#define HIGH_PRIORITY 0
+#define DEFAULT_PRIORITY LOW_PRIORITY
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/README b/TAO/DevGuideExamples/NotifyService/RTNotify/README
new file mode 100644
index 00000000000..590d2a265d4
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/README
@@ -0,0 +1,67 @@
+Event Notification Service
+
+
+File: examples/NotifyService/RTNotify/README
+
+This directory contains a simple example of using the Notification Service
+with Real-Time CORBA.
+
+This example extends the basic Messenger notify service example to illustrate
+how the Notification channel can be used with RT CORBA features. The supplier
+and consumer both set up their proxies to use a thread pool with lanes and
+the Notify_Service executable is configured to load the RT_Notification library
+and associated features. A priority is set in the supplier and propagetd through
+the channel into the consumer.
+
+The MessengerServer in this example plays the role of a server for
+the MessengerClient and the role of a supplier for the MessengerConsumer.
+The flow of messages is shown below:
+
+MessengerClient->MessengerSupplier->NotificationChannel->MessengerConsumer.
+
+
+The Client code is stored in:
+
+examples/NotifyService/Messenger/MessengerClient.cpp
+
+The Server code is stored in:
+
+examples/NotifyService/Messenger/MessengerServer.cpp
+
+The Consumer code is stored in:
+
+examples/NotifyService/Messenger/MessengerConsumer.cpp
+
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
+
+To start the Notification Service:
+---------------------------------
+$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBInitRef NameService=file://ns.iori -ORBSvcConf notify.conf &
+
+To start the server/supplier
+----------------------------
+./MessengerServer -ORBInitRef NameService=file://ns.ior -ORBSvcConf nsclient.conf
+
+To start the consumer
+---------------------
+./MessengerConsumer -ORBInitRef NameService=file://ns.ior -ORBSvcConf nsclient.conf
+
+To start the client
+-------------------
+./MessengerClient -ORBInitRef NameService=file://ns.ior
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/RTNotify.mpc b/TAO/DevGuideExamples/NotifyService/RTNotify/RTNotify.mpc
new file mode 100644
index 00000000000..ddc1d2dddd5
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/RTNotify.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, namingexe, notification_skel, rtcorba {
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, notification {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): taoexe, portableserver, namingexe, notification_skel, rtportableserver {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..ae1208c30d3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.cpp
@@ -0,0 +1,50 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+
+{
+
+ std::cout << "event received " << std::endl;
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
+ }
+
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer()
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..be60942df06
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventConsumer_i.h
@@ -0,0 +1,31 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyCommS.h>
+
+class StructuredEventConsumer_i :
+ public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ )
+ throw (CORBA::SystemException, CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_structured_push_consumer()
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..91139284edd
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.cpp
@@ -0,0 +1,31 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier ()
+ throw(CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..1b5b5dc7250
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/StructuredEventSupplier_i.h
@@ -0,0 +1,24 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyCommS.h>
+
+class StructuredEventSupplier_i :
+ public virtual POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier ()
+ throw(CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ )
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType);
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/notify.conf b/TAO/DevGuideExamples/NotifyService/RTNotify/notify.conf
new file mode 100644
index 00000000000..837d36af6c7
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/notify.conf
@@ -0,0 +1,6 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous"
+
+# Uncomment this line to use SCHED_FIFO
+#dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/nsclient.conf b/TAO/DevGuideExamples/NotifyService/RTNotify/nsclient.conf
new file mode 100644
index 00000000000..c121382ee7d
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/nsclient.conf
@@ -0,0 +1,4 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous"
+
+# Uncomment this line to use SCHED_FIFO
+#dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
diff --git a/TAO/DevGuideExamples/NotifyService/RTNotify/run_test.pl b/TAO/DevGuideExamples/NotifyService/RTNotify/run_test.pl
new file mode 100644
index 00000000000..6102b28335a
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/RTNotify/run_test.pl
@@ -0,0 +1,80 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$notify_ior = PerlACE::LocalFile("notify.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Notification Service
+
+$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
+$NFS = new PerlACE::Process($NotifyService,
+ "$arg_ns_ref -IORoutput $notify_ior " .
+ "-ORBSvcConf notify.conf");
+$NFS->Spawn();
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer",
+ "$arg_ns_ref -ORBSvcConf nsclient.conf");
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 15) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ $NFS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer",
+ "$arg_ns_ref -ORBSvcConf nsclient.conf");
+$MC->Spawn();
+
+sleep(2);
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", "");
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NFS->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NFS->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+unlink $notify_ior;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger.idl b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger.idl
new file mode 100644
index 00000000000..2ad676a6cc5
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger.idl
@@ -0,0 +1,14 @@
+// messenger.idl
+
+
+interface Messenger
+{
+
+ boolean send_message(in string user_name,
+
+ in string subject,
+
+ inout string message);
+
+};
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerClient.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerClient.cpp
new file mode 100644
index 00000000000..2d1b1147326
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerClient.cpp
@@ -0,0 +1,56 @@
+#include <orbsvcs/CosNamingC.h>
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var rootObj =
+ orb->resolve_initial_references("NameService");
+
+ CosNaming::NamingContext_var rootContext =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("MessengerService");
+
+ CORBA::Object_var messengerObj = rootContext->resolve(name);
+
+ if (CORBA::is_nil(messengerObj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow(messengerObj.in());
+ if (CORBA::is_nil(messenger.in ())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message =
+ CORBA::string_dup("Where can I get TAO?");
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+
+ message = CORBA::string_dup("I need TAO now.");
+ messenger->send_message ("person@company.com",
+ "OCI's Distribution of TAO",
+ message.inout());
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ std::cout << "MessengerClient: success" << std::endl;
+ return 0;
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerConsumer.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerConsumer.cpp
new file mode 100644
index 00000000000..712be03f706
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerConsumer.cpp
@@ -0,0 +1,139 @@
+#include <ace/Get_Opt.h>
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "StructuredEventConsumer_i.h"
+#include <iostream>
+
+#define CA_FILTER "Subject == 'OCI_TAO'"
+#define TCL_GRAMMAR "TCL"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ return 1;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+ CosNaming::Name name(1);
+ name.length (1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ CORBA::Object_var ecObj = naming_context->resolve(name);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ CosNotifyChannelAdmin::EventChannel::_narrow(ecObj.in());
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to find event channel" << std::endl;
+ return 1;
+ }
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::AND_OP;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(ifgop,
+ adminid);
+
+ if (CORBA::is_nil (consumer_admin.in())) {
+ std::cerr << "Unable to find consumer admin" << std::endl;
+ return 1;
+ }
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory ();
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var ca_filter =
+ ffact->create_filter (TCL_GRAMMAR);
+
+ if (CORBA::is_nil (ca_filter.in())) {
+ std::cerr << "Unable to create filetr object" << std::endl;
+ return 1;
+ }
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (CA_FILTER);
+
+ ca_filter->add_constraints (constraint_list);
+
+ consumer_admin ->add_filter (ca_filter.in());
+
+ CosNotification::EventTypeSeq added(1);
+ CosNotification::EventTypeSeq removed (0);
+ added.length (1);
+ removed.length (0);
+
+ added[0].domain_name = CORBA::string_dup ("*");
+ added[0].type_name = CORBA::string_dup ("*");
+
+ consumer_admin->subscription_change (added, removed);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in())) {
+ std::cerr << "Unable to initialize the POA." << std::endl;
+ return 1;
+ }
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow(poa_object.in());
+
+ StructuredEventConsumer_i servant(orb.in());
+
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
+ CosNotifyComm::StructuredPushConsumer_var consumer =
+ CosNotifyComm::StructuredPushConsumer::_narrow(consumer_obj.in());
+
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ consumer_admin->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id);
+
+
+ // The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
+ supplier_proxy = CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow(proxy_supplier.in());
+
+ if (CORBA::is_nil (supplier_proxy.in())) {
+ std::cerr << "Unable to create structured push supplier proxy" << std::endl;
+ return 1;
+ }
+
+ supplier_proxy->connect_structured_push_consumer(consumer.in());
+
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager();
+
+ poa_manager->activate();
+
+ orb->run();
+ orb->destroy ();
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerServer.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerServer.cpp
new file mode 100644
index 00000000000..dcf76593920
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerServer.cpp
@@ -0,0 +1,59 @@
+#include <orbsvcs/CosNamingC.h>
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Find the Naming Service.
+ CORBA::Object_var rootObj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ // Get the 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();
+
+ // Create our Messenger servant.
+ Messenger_i messenger_servant(orb.in());
+
+ // Register it with the RootPOA.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ // Bind it in the Naming Service.
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup("MessengerService");
+ rootNC->rebind(name, messenger_obj.in());
+
+ CORBA::String_var str = orb->object_to_string (messenger_obj.in());
+ std::ofstream iorFile ("Messenger.ior");
+ iorFile << str.in () << std::endl;
+ iorFile.close ();
+ std::cout << "IOR written to file Messenger.ior " << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+
+}
+
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerSupplier.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerSupplier.cpp
new file mode 100644
index 00000000000..c2e488603c2
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/MessengerSupplier.cpp
@@ -0,0 +1,95 @@
+#include <orbsvcs/Notify/Notify_EventChannelFactory_i.h>
+#include <orbsvcs/CosNamingC.h>
+#include <ace/Profile_Timer.h>
+#include "StructuredEventSupplier_i.h"
+#include <iostream>
+
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ CORBA::Object_var rootObj = orb->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow(rootObj.in());
+
+ // 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();
+
+ // Create an Event Channel factory.
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ TAO_Notify_EventChannelFactory_i::create(poa.in());
+ ACE_ASSERT (!CORBA::is_nil (notify_factory.in ()));
+
+ // Create an Event Channel.
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos, initial_admin, id);
+
+ // Bind it in the Naming Service.
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+ rootNC->rebind(name, ec.in());
+
+ // Become a structured push supplier.
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb.in());
+ CosNotifyComm::StructuredPushSupplier_var supplier = servant->_this();
+
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(
+ proxy_consumer.in());
+ consumer_proxy->connect_structured_push_supplier(supplier.in());
+
+ // Set up events to push.
+ CosNotification::StructuredEvent event;
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("Message from:");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject:");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message:");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ // Push events.
+ while (1) {
+ std::cout << "pushing " << std::endl;
+ consumer_proxy->push_structured_event (event);
+ ACE_OS::sleep (1);
+ }
+ }
+ catch(const CORBA::Exception& ex) {
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.cpp
new file mode 100644
index 00000000000..b05d25defca
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.cpp
@@ -0,0 +1,172 @@
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/Notify/Notify_EventChannelFactory_i.h>
+
+// The static initialization trick doesn't work with static builds.
+// On SunOS 5.8 and MacOS X, the static initialization trick used
+// in the CosNotification_Serv library does not work. Including the
+// initializer class here works around the problem.
+#if defined (TAO_AS_STATIC_LIBS) || defined (sun) || defined (__APPLE__)
+#include <orbsvcs/Notify/CosNotify_Initializer.h>
+#endif /* sun || __APPLE__ */
+
+#include "Messenger_i.h"
+#include "StructuredEventSupplier_i.h"
+#include <iostream>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb)
+: orb_ (CORBA::ORB::_duplicate(orb))
+
+{
+ try
+ {
+ CORBA::Object_var poa_obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(poa_obj.in());
+
+ CORBA::Object_var naming_obj =
+ orb_->resolve_initial_references ("NameService");
+
+ if (CORBA::is_nil(naming_obj.in())) {
+ std::cerr << "Unable to find naming service" << std::endl;
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+
+
+ //
+ // Create an instance of TAO's notification event channel
+ //
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ TAO_Notify_EventChannelFactory_i::create(poa.in());
+
+ if (CORBA::is_nil (notify_factory.in ())) {
+ std::cerr << "Unable to create the notify event channel" << std::endl;
+ return;
+ }
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ if (CORBA::is_nil (ec.in())) {
+ std::cerr << "Unable to create event channel" << std::endl;
+ return;
+ }
+
+
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup("MyEventChannel");
+
+ naming_context->rebind(name, ec.in());
+
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::AND_OP;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop, adminid);
+
+ if (CORBA::is_nil (supplier_admin.in())) {
+ std::cerr << "Unable to find supplier admin" << std::endl;
+ }
+
+ CosNotifyChannelAdmin::ProxyID supplieradmin_proxy_id;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ supplier_admin->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ supplieradmin_proxy_id);
+
+ StructuredEventSupplier_i *servant =
+ new StructuredEventSupplier_i(orb_.in());
+
+ PortableServer::ObjectId_var oid = poa->activate_object(servant);
+ CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
+ CosNotifyComm::StructuredPushSupplier_var supplier =
+ CosNotifyComm::StructuredPushSupplier::_narrow(supplier_obj.in());
+
+ consumer_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::
+ _narrow(proxy_consumer.in());
+
+ if (CORBA::is_nil (consumer_proxy_.in())) {
+ std::cerr << "Unable to find structured proxy push consumer" << std::endl;
+ }
+
+ consumer_proxy_->connect_structured_push_supplier(supplier.in());
+
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ }
+
+}
+
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException)
+{
+
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+
+ try
+ {
+
+ // Event Definition
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("OCI_TAO");
+ // string
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("examples");
+ // string
+ event.header.fixed_header.event_name =
+ CORBA::string_dup("myevent");
+
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("From");
+ event.filterable_data[0].value <<= (const char *)user_name;
+ event.filterable_data.length (2);
+ event.filterable_data[1].name = CORBA::string_dup("Subject");
+ event.filterable_data[1].value <<= (const char *)subject;
+ event.filterable_data.length (3);
+ event.filterable_data[2].name = CORBA::string_dup("Message");
+ event.filterable_data[2].value <<= (const char *)message;
+
+ consumer_proxy_->push_structured_event(event);
+ }
+
+ catch(const CosNotifyComm::InvalidEventType&) {
+ std::cerr << "Invalid Event Type Exception " << std::endl;
+ return 1;
+ }
+
+ catch(const CORBA::Exception& ex) {
+ std::cerr << ex << std::endl;
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.h b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.h
new file mode 100644
index 00000000000..2353918a2e9
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/Messenger_i.h
@@ -0,0 +1,34 @@
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNamingC.h>
+
+#include "MessengerS.h"
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_proxy_;
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/README b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/README
new file mode 100644
index 00000000000..af40d53a719
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/README
@@ -0,0 +1,43 @@
+
+examples/NotifyService/SupplierSideNC/README
+
+This directory contains a simple example of using the Notification Service.
+
+This example extends the Messenger example in Filtering directory
+to illustrate how the Notification channel can be used to push messages
+from the supplier to the consumer. Furthermore, this example shows
+how you could set up filters so that only a certain events are
+passed to the consumer.
+
+This example uses the push/push model.
+
+In this example, the Notify Service initiation is incorporated into the
+MessengerServer.
+
+The MessengerSupplier in this example plays the role of a server for
+the MessengerClient and the role of a supplier for the MessengerConsumer.
+The flow of messages is shown below:
+
+MessengerClient->(MessengerSupplier->NotificationChannel)->MessengerConsumer.
+
+How to Run
+----------
+
+To start the Naming Service:
+----------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service &
+
+To start the supplier:
+------------------
+./MessengerServer
+
+To start the consumer
+---------------------
+./MessengerConsumer
+
+To start the client
+-------------------
+./MessengerClient
+To start the client:
+------------------
+./MessengerClient
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp
new file mode 100644
index 00000000000..a507d01c29f
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.cpp
@@ -0,0 +1,50 @@
+#include "StructuredEventConsumer_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+#include <iostream>
+
+StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
+ : orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventConsumer_i::push_structured_event(
+ const CosNotification::StructuredEvent &event)
+ throw (CORBA::SystemException,
+ CosEventComm::Disconnected)
+{
+
+ const char *value;
+
+ for (unsigned int i=0; i<event.filterable_data.length(); i++) {
+ event.filterable_data[i].value >>= value;
+ std::cout << event.filterable_data[i].name << "\t" <<value<< std::endl;
+ }
+
+ std::cerr << "MessengerConsumer: success" << std::endl;
+}
+
+void
+StructuredEventConsumer_i::disconnect_structured_push_consumer()
+ throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventConsumer_i::offer_change(
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &)
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType)
+
+{
+ //Noop
+}
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.h b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.h
new file mode 100644
index 00000000000..37d4d3a82c3
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventConsumer_i.h
@@ -0,0 +1,29 @@
+#ifndef _EVENTCONSUMER_I_H_
+#define _EVENTCONSUMER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventConsumer_i : public POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredEventConsumer_i(CORBA::ORB_ptr orb);
+
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification)
+ throw (CORBA::SystemException,
+ CosEventComm::Disconnected);
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed)
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType);
+
+ virtual void disconnect_structured_push_consumer()
+ throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp
new file mode 100644
index 00000000000..be20808ff7e
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.cpp
@@ -0,0 +1,31 @@
+#include "StructuredEventSupplier_i.h"
+#include <tao/PortableServer/PS_CurrentC.h>
+
+StructuredEventSupplier_i::StructuredEventSupplier_i(CORBA::ORB_ptr orb)
+: orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+void
+StructuredEventSupplier_i::disconnect_structured_push_supplier ()
+throw (CORBA::SystemException)
+{
+
+ CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
+ PortableServer::Current_var current =
+ PortableServer::Current::_narrow (obj.in());
+ PortableServer::POA_var poa = current->get_POA ();
+ PortableServer::ObjectId_var objectId = current->get_object_id ();
+ poa->deactivate_object (objectId.in());
+
+}
+
+void
+StructuredEventSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq &,
+ const CosNotification::EventTypeSeq &)
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType)
+{
+}
+
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.h b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.h
new file mode 100644
index 00000000000..5de5db6220f
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/StructuredEventSupplier_i.h
@@ -0,0 +1,25 @@
+#ifndef _EVENTSUPPLIER_I_H_
+#define _EVENTSUPPLIER_I_H_
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+
+class StructuredEventSupplier_i : public POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // Constructor
+ StructuredEventSupplier_i(CORBA::ORB_ptr orb);
+ virtual void disconnect_structured_push_supplier ()
+ throw (CORBA::SystemException);
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed)
+
+ throw (CORBA::SystemException,
+ CosNotifyComm::InvalidEventType);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/SupplierSideNC.mpc b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/SupplierSideNC.mpc
new file mode 100644
index 00000000000..50383993728
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/SupplierSideNC.mpc
@@ -0,0 +1,23 @@
+project(*Server): taoexe, portableserver, namingexe, notification_serv {
+ Source_Files {
+ StructuredEventSupplier_i.cpp
+ MessengerServer.cpp
+ Messenger_i.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, notification {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
+
+project(*Consumer): taoexe, portableserver, namingexe, notification_skel {
+ IDL_Files {
+ }
+ Source_Files {
+ MessengerConsumer.cpp
+ StructuredEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/NotifyService/SupplierSideNC/run_test.pl b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/run_test.pl
new file mode 100644
index 00000000000..3f7e4817547
--- /dev/null
+++ b/TAO/DevGuideExamples/NotifyService/SupplierSideNC/run_test.pl
@@ -0,0 +1,56 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+$messiorfile = PerlACE::LocalFile("Messenger.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+unlink $nsiorfile;
+unlink $messiorfile;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
+$S->Spawn();
+
+# Wait for the MessengerServer
+if (PerlACE::waitforfile_timed ($messiorfile, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for $messiorfile\n";
+ $S->Kill();
+ $NS->Kill ();
+ exit 1;
+}
+# start MessengerConsumer
+$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
+$MC->Spawn();
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);
+if ($C->SpawnWaitKill(10) != 0) {
+ $MC->Kill();
+ $S->Kill();
+ $NS->Kill();
+ exit (1);
+}
+
+$MC->Kill();
+$S->Kill();
+$NS->Kill();
+
+unlink $nsiorfile;
+unlink $messiorfile;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/Auth.mpc b/TAO/DevGuideExamples/PortableInterceptors/Auth/Auth.mpc
new file mode 100644
index 00000000000..eefa89004eb
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/Auth.mpc
@@ -0,0 +1,17 @@
+project(*Server): taoexe, portableserver, namingexe, pi_server, avoids_minimum_corba {
+ Source_Files {
+ Messenger_i.cpp
+ ServerInitializer.cpp
+ ServerInterceptor.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, pi, avoids_minimum_corba, interceptors {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ ClientInitializer.cpp
+ ClientInterceptor.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.cpp
new file mode 100644
index 00000000000..816f42d67e0
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.cpp
@@ -0,0 +1,36 @@
+#include "ClientInitializer.h"
+#include "ClientInterceptor.h"
+#include <iostream>
+
+ClientInitializer::ClientInitializer (void)
+{
+}
+
+void
+ClientInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+void
+ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
+{
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ClientRequestInterceptor_ptr ci =
+ PortableInterceptor::ClientRequestInterceptor::_nil ();
+
+ try
+ {
+ ci = new ClientInterceptor();
+ }
+ catch(...)
+ {
+ std::cerr << "Exception ocurred creating ClientInterceptor" << std::endl;
+ }
+
+ PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
+ ci;
+
+ info->add_client_request_interceptor (ci_interceptor.in ());
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.h
new file mode 100644
index 00000000000..ffd77584d39
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInitializer.h
@@ -0,0 +1,19 @@
+#ifndef CLIENTINITIALIZER_H
+#define CLIENTINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+
+class ClientInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ ClientInitializer (void);
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.cpp
new file mode 100644
index 00000000000..21cd2e19be7
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.cpp
@@ -0,0 +1,96 @@
+#include "ClientInterceptor.h"
+#include <tao/OctetSeqC.h>
+#include <tao/PI/ClientRequestInfo.h>
+#include <ace/OS_NS_string.h>
+#include <iostream>
+
+const CORBA::ULong service_ctx_id = 0xdeed;
+
+ClientInterceptor::
+ClientInterceptor (void)
+ : myname_ ("Client_Authentication_Interceptor")
+{
+ std::cout << "Calling ClientInterceptor constructor." << std::endl;
+}
+
+ClientInterceptor::~ClientInterceptor (void)
+{
+}
+
+char *
+ClientInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ClientInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ClientInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInterceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling send_poll()." << std::endl;
+}
+
+
+void
+ClientInterceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling send_request()." << std::endl;
+
+ IOP::ServiceContext sc;
+ sc.context_id = service_ctx_id;
+
+ const char user_name[] = "Ron Klein";
+ std::cout << "User's Name: " << user_name << std::endl;
+ CORBA::ULong string_len = sizeof (user_name) + 1;
+ CORBA::Octet *buf = 0;
+
+ buf = new CORBA::Octet [string_len];
+
+ ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
+
+ sc.context_data.replace (string_len, string_len, buf, 1);
+
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc, 0);
+
+}
+
+void
+ClientInterceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_reply()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling receive_other()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_exception()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.h
new file mode 100644
index 00000000000..4882eaac54c
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ClientInterceptor.h
@@ -0,0 +1,46 @@
+#ifndef CLIENTINTERCEPTOR_H
+#define CLIENTINTERCEPTOR_H
+
+#include <tao/PortableInterceptorC.h>
+#include <tao/LocalObject.h>
+#include <tao/PI/PI.h>
+
+class ClientInterceptor
+: public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+
+ public:
+ ClientInterceptor (void);
+
+ virtual ~ClientInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger.idl b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerClient.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerClient.cpp
new file mode 100644
index 00000000000..9c3ddf77134
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerClient.cpp
@@ -0,0 +1,50 @@
+#include "MessengerC.h"
+#include "ClientInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI library is linked in when building statically
+#include <tao/PI/PI.h>
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ temp_initializer = new ClientInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "Client ORB");
+
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+
+ if ( CORBA::is_nil(obj.in() ) ) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerServer.cpp
new file mode 100644
index 00000000000..5a9757a9655
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/MessengerServer.cpp
@@ -0,0 +1,59 @@
+#include "Messenger_i.h"
+#include "MessengerS.h"
+#include "ServerInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI_Server library is linked in when building statically
+#include <tao/PI_Server/PI_Server.h>
+#include <iostream>
+#include <fstream>
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ ServerInitializer *temp_initializer = 0;
+
+ temp_initializer = new ServerInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB");
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile ( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << std::endl << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.cpp
new file mode 100644
index 00000000000..41786a4e1c8
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.cpp
@@ -0,0 +1,43 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.h b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.h
new file mode 100644
index 00000000000..99ceb257dfd
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/Messenger_i.h
@@ -0,0 +1,41 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/README b/TAO/DevGuideExamples/PortableInterceptors/Auth/README
new file mode 100644
index 00000000000..6b6ce299369
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/README
@@ -0,0 +1,36 @@
+Portable Interceptors
+
+
+File: DevGuideExamples/PortableInterceptor/Auth/README
+
+
+This directory contains an example illustrating client and server
+Request Interceptors.
+
+This is a simple insecure authentication example that is based on
+the Messenger example in GettingStarted directory. A message is
+sent by MessengerClient and displayed by MessengerServer. A client-side
+portable interceptor adds a username to each request sent to the server.
+A server-side interceptor verifies that the supplied username is valid.
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.cpp
new file mode 100644
index 00000000000..e22e1af87f0
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.cpp
@@ -0,0 +1,44 @@
+#include "ServerInitializer.h"
+#include "ServerInterceptor.h"
+
+#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+ServerInitializer::ServerInitializer ()
+{
+}
+
+void
+ServerInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ServerRequestInterceptor_ptr si =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+
+ try
+ {
+ si = new ServerInterceptor ();
+ }
+ catch(...)
+ {
+ std::cerr << "Exception occured trying to create ServerInterceptor." << std::endl;
+ }
+
+ PortableInterceptor::ServerRequestInterceptor_var si_interceptor =
+ si;
+
+ info->add_server_request_interceptor (si_interceptor.in ());
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.h
new file mode 100644
index 00000000000..f07b7821cb2
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.h
@@ -0,0 +1,23 @@
+#ifndef SERVERINITIALIZER_H
+#define SERVERINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI/PI.h"
+
+class ServerInitializer :
+public virtual PortableInterceptor::ORBInitializer
+{
+ public:
+ ServerInitializer ();
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ int interceptor_type_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.cpp
new file mode 100644
index 00000000000..04b4e47f498
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.cpp
@@ -0,0 +1,116 @@
+#include "ServerInterceptor.h"
+#include <tao/PI_Server/ServerRequestInfoA.h>
+#include <ace/OS_NS_string.h>
+#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+const IOP::ServiceId service_id = 0xdeed;
+const unsigned int num_allowed_users = 4;
+static const char* allowed_users[num_allowed_users+1] =
+ {"Ron Klein", "Scott Case", "Mark Hodge", "Greg Black", 0};
+const char* restricted_interfaces[1] = {"IDL:Messenger:1.0"};
+
+ServerInterceptor::ServerInterceptor (void)
+ : myname_ ("Server_Authentication_Interceptor")
+{
+ std::cout << "Calling ServerInterceptor constructor." << std::endl;
+}
+
+ServerInterceptor::~ServerInterceptor ()
+{
+}
+
+char *
+ServerInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ServerInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ServerInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling destroy()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_request_service_contexts()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ bool permission_granted = false;
+ std::cout << "Calling receive_request()." << std::endl;
+
+ if (ri->target_is_a(restricted_interfaces[0])){
+ IOP::ServiceId id = service_id;
+ // Check that the request service context can be retrieved.
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+
+ CORBA::OctetSeq ocSeq = sc->context_data;
+
+ const char * buf =
+ reinterpret_cast<const char *> (ocSeq.get_buffer ());
+
+ for (unsigned int i=0; i<num_allowed_users; ++i) {
+ if (ACE_OS::strcmp (buf, allowed_users[i]) == 0)
+ {
+ permission_granted = true;
+ }
+ }
+ }
+
+ if (permission_granted == true) {
+ std::cout << "Permission Granted " << std::endl;
+ }
+ else {
+ std::cout << "Permission Denied " << std::endl;
+ throw CORBA::NO_PERMISSION();
+ }
+}
+
+void
+ServerInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_reply()." << std::endl;
+}
+
+void
+ServerInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_exception()." << std::endl;
+}
+
+void
+ServerInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_other()." << std::endl;
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.h
new file mode 100644
index 00000000000..d0eb11ee704
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInterceptor.h
@@ -0,0 +1,45 @@
+#ifndef SERVERINTERCEPTOR_H
+#define SERVERINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/ServerRequestInterceptorA.h"
+
+class ServerInterceptor
+: public PortableInterceptor::ServerRequestInterceptor
+{
+ public:
+ ServerInterceptor (void);
+
+ ~ServerInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/Auth/run_test.pl b/TAO/DevGuideExamples/PortableInterceptors/Auth/run_test.pl
new file mode 100644
index 00000000000..8804f7ba6d8
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/Auth/run_test.pl
@@ -0,0 +1,36 @@
+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;
+
+# start MessengerServer
+my($iorfile) = 'Messenger.ior';
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed (
+ $iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill();
+ exit(1);
+}
+
+# start MessengerClient
+select undef, undef, undef, .5;
+$C = new PerlACE::Process("MessengerClient");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.cpp
new file mode 100644
index 00000000000..6abd46ca4c0
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.cpp
@@ -0,0 +1,45 @@
+#include "ClientInitializer.h"
+#include "ClientInterceptor.h"
+#include <iostream>
+
+ClientInitializer::ClientInitializer (void)
+{
+}
+
+void
+ClientInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ // get Codec factory
+ IOP::CodecFactory_var codec_factory = info->codec_factory();
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ClientRequestInterceptor_ptr ci =
+ PortableInterceptor::ClientRequestInterceptor::_nil ();
+
+ try
+ {
+ ci = new ClientInterceptor (codec_factory);
+ }
+ catch(...)
+ {
+ std::cerr << "Exception occurred trying to create ClientInterceptor." << std::endl;
+ }
+
+ PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
+ ci;
+
+ info->add_client_request_interceptor (ci_interceptor.in ());
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.h
new file mode 100644
index 00000000000..9536c6ce776
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInitializer.h
@@ -0,0 +1,21 @@
+#ifndef CLIENTINITIALIZER_H
+#define CLIENTINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+
+class ClientInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+ public:
+ ClientInitializer (void);
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.cpp
new file mode 100644
index 00000000000..c919423a0eb
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.cpp
@@ -0,0 +1,123 @@
+#include "ClientInterceptor.h"
+#include "tao/OctetSeqC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/ClientRequestInfo.h"
+
+#include <iostream>
+
+const CORBA::ULong service_ctx_id = 0xdeed;
+
+ClientInterceptor::
+ClientInterceptor (IOP::CodecFactory_var cf)
+ : myname_ ("Client_Authentication_Interceptor")
+{
+ std::cout << "Calling ClientInterceptor constructor." << std::endl;
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ this->codec = cf->create_codec (encoding);
+}
+
+ClientInterceptor::~ClientInterceptor (void)
+{
+}
+
+char *
+ClientInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ClientInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ClientInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInterceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_poll()." << std::endl;
+}
+
+
+void
+ClientInterceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling send_request()." << std::endl;
+
+ const CORBA::ULong tagID = 9654;
+
+ try
+ {
+ IOP::TaggedComponent_var myTag = ri->get_effective_component(tagID);
+ char *tag =
+ reinterpret_cast<char*> (myTag->component_data.get_buffer());
+
+ std::cout << "IOR Tag is : " << tag << std::endl;
+ }
+ catch(...)
+ {
+ std::cerr << "Tagged Component not found" << std::endl;
+ }
+
+ IOP::ServiceContext sc;
+ sc.context_id = service_ctx_id;
+
+ const CORBA::Long gid = 9007;
+
+ std::cout << "GID: " << gid << std::endl;
+
+ CORBA::Any gid_as_any;
+ gid_as_any <<= gid;
+
+ sc.context_data = reinterpret_cast<CORBA::OctetSeq&>(
+ *codec->encode(gid_as_any));
+
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc, 0);
+
+}
+
+void
+ClientInterceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_reply()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_other()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_exception()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.h
new file mode 100644
index 00000000000..445a601d082
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ClientInterceptor.h
@@ -0,0 +1,48 @@
+#ifndef CLIENTINTERCEPTOR_H
+#define CLIENTINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/ClientRequestInterceptorA.h"
+#include "tao/PI/ORBInitInfo.h"
+
+class ClientInterceptor:
+ public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+
+ public:
+ ClientInterceptor (IOP::CodecFactory_var) ;
+
+ virtual ~ClientInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+ IOP::Codec_var codec;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/IOR.mpc b/TAO/DevGuideExamples/PortableInterceptors/IOR/IOR.mpc
new file mode 100644
index 00000000000..cc7e4118767
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/IOR.mpc
@@ -0,0 +1,18 @@
+project(*Server): taoexe, portableserver, pi_server, avoids_minimum_corba, iorinterceptor {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ ServerInitializer.cpp
+ ServerInterceptor.cpp
+ ServerIORInterceptor.cpp
+ }
+}
+
+project(*Client): taoexe, pi, avoids_minimum_corba, interceptors {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ ClientInitializer.cpp
+ ClientInterceptor.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger.idl b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger.idl
new file mode 100644
index 00000000000..f2a0074c1e8
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger.idl
@@ -0,0 +1,6 @@
+#include "orb.idl"
+
+interface Messenger
+{
+ void send_message(in CORBA::OctetSeq user_name);
+};
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerClient.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerClient.cpp
new file mode 100644
index 00000000000..f60cd3143ed
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerClient.cpp
@@ -0,0 +1,84 @@
+#include "MessengerC.h"
+#include "ClientInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI library is linked in when building statically
+#include <tao/PI/PI.h>
+#include <iostream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ temp_initializer = new ClientInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Destringify ior
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Obtain a reference to the CodecFactory.
+ CORBA::Object_var obj2 =
+ orb->resolve_initial_references ("CodecFactory");
+
+ IOP::CodecFactory_var codec_factory;
+
+ if(CORBA::is_nil(obj2.in()))
+ {
+ std::cerr << "Error: codec_factory" << std::endl;
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow (obj2.in ());
+ std::cout << "got codec factory" << std::endl;
+ }
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ IOP::Codec_var codec =
+ codec_factory->create_codec (encoding);
+
+ CORBA::Long uid = 64321;
+
+ CORBA::Any uid_as_any;
+
+ uid_as_any <<= uid;
+ CORBA::OctetSeq client_uid = *codec->encode (uid_as_any);
+ messenger->send_message( client_uid );
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Exception in MessengerClient: " << ex << std::endl;
+ return 1;
+ }
+
+ std::cout << "message was sent" << std::endl;
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerServer.cpp
new file mode 100644
index 00000000000..03493a5c5af
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/MessengerServer.cpp
@@ -0,0 +1,59 @@
+#include "Messenger_i.h"
+#include "MessengerC.h"
+#include "ServerInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI_Server library is linked in when building statically
+#include <tao/PI_Server/PI_Server.h>
+#include <iostream>
+#include <fstream>
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ ServerInitializer *temp_initializer = 0;
+ temp_initializer = new ServerInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Exception in MessengerServer: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.cpp
new file mode 100644
index 00000000000..eb4520c600b
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.cpp
@@ -0,0 +1,75 @@
+#include <tao/CodecFactory/CodecFactory.h>
+#include <ace/OS_NS_string.h>
+#include <iostream>
+#include "Messenger_i.h"
+
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+
+void Messenger_i::send_message (const CORBA::OctetSeq & user_name)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ try
+ {
+ int argc = 1;
+ char **argv = new char *[argc];
+ argv[0] = new char[ACE_OS::strlen ("MessengerServer")];
+ strcpy (argv[0], "MessengerServer");
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ // Obtain a reference to the CodecFactory.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("CodecFactory");
+
+ IOP::CodecFactory_var codec_factory;
+
+ if(CORBA::is_nil(obj.in()))
+ {
+ std::cerr << "Error: codec_factory" << std::endl;
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow (obj.in ());
+ std::cout << "Server got codec factory" << std::endl;
+ }
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ IOP::Codec_var codec =
+ codec_factory->create_codec (encoding);
+
+ CORBA::Any uid_as_any;
+ uid_as_any = *(codec->decode(user_name));
+
+ CORBA::Long uid;
+ uid_as_any >>= uid;
+ std::cout << "UID: " << uid << std::endl;
+
+ }
+
+ catch(...)
+ {
+ std::cerr << "exception received" << std::endl;
+ ACE_OS::exit(1);
+ }
+
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.h
new file mode 100644
index 00000000000..dc3e46058f5
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/Messenger_i.h
@@ -0,0 +1,29 @@
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+ public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+
+ virtual void send_message (const CORBA::OctetSeq & user_name)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/README b/TAO/DevGuideExamples/PortableInterceptors/IOR/README
new file mode 100644
index 00000000000..1fc72cbf7f4
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/README
@@ -0,0 +1,35 @@
+Portable Interceptors
+
+
+File: DevGuideExamples/PortableInterceptor/IOR/README
+
+
+This directory contains an example of using portable interceptors to add
+tagged information to an IOR.
+
+This example is based on the Messenger example in GettingStarted
+directory. A message is send by MessengerClient and displayed by
+MessengerServer. On IOR creation, the server has added a special
+tag "ServerRequiresAuth". The client is able to extract this tag.
+
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+Execution via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.cpp
new file mode 100644
index 00000000000..43ad1333ee6
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.cpp
@@ -0,0 +1,40 @@
+#include "ServerIORInterceptor.h"
+#include <iostream>
+char *
+ServerIORInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("ServerIORInterceptor");
+}
+
+void
+ServerIORInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerIORInterceptor::establish_components (
+ PortableInterceptor::IORInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ const char * permission = "ServerRequiresAuth";
+
+ // arbitrary tag.
+ CORBA::ULong tagID = 9654;
+
+ IOP::TaggedComponent myTag;
+
+ myTag.tag = tagID;
+ myTag.component_data.length (ACE_OS::strlen(permission) + 1 );
+
+ CORBA::Octet *buf = myTag.component_data.get_buffer();
+
+ ACE_OS::memcpy (buf, permission, ACE_OS::strlen(permission) + 1);
+
+ // add tagged component
+ info->add_ior_component (myTag);
+
+ std::cout << "Created Tagged IOR." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.h
new file mode 100644
index 00000000000..9dd6c080b45
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.h
@@ -0,0 +1,50 @@
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/IORInterceptor_Adapter.h"
+#include "tao/IORInterceptor/IORInterceptor.h"
+
+class ServerIORInterceptor :
+public virtual PortableInterceptor::IORInterceptor,
+public virtual TAO_Local_RefCounted_Object
+{
+ public:
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void establish_components (
+ PortableInterceptor::IORInfo_ptr info
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void components_established (
+ PortableInterceptor::IORInfo_ptr /*info*/
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+ {
+ }
+
+ virtual void adapter_manager_state_changed (
+ PortableInterceptor::AdapterManagerId /*id*/,
+ PortableInterceptor::AdapterState /*state*/
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+ {
+ }
+
+ virtual void adapter_state_changed (
+ const PortableInterceptor::ObjectReferenceTemplateSeq& /*templates*/,
+ PortableInterceptor::AdapterState /*state*/
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+ {
+ }
+};
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.cpp
new file mode 100644
index 00000000000..b275cf004ea
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.cpp
@@ -0,0 +1,32 @@
+#include "ServerInitializer.h"
+#include "ServerInterceptor.h"
+#include "ServerIORInterceptor.h"
+
+ServerInitializer::ServerInitializer ()
+{
+}
+
+void
+ServerInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // get reference to the codec_factory
+ IOP::CodecFactory_var codec_factory = info->codec_factory();
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ServerRequestInterceptor_var si =
+ new ServerInterceptor (codec_factory);
+ info->add_server_request_interceptor (si.in());
+
+ // add IOR Interceptor
+ PortableInterceptor::IORInterceptor_var iori = new ServerIORInterceptor;
+ info->add_ior_interceptor (iori.in());
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.h
new file mode 100644
index 00000000000..f07b7821cb2
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInitializer.h
@@ -0,0 +1,23 @@
+#ifndef SERVERINITIALIZER_H
+#define SERVERINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI/PI.h"
+
+class ServerInitializer :
+public virtual PortableInterceptor::ORBInitializer
+{
+ public:
+ ServerInitializer ();
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ int interceptor_type_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.cpp
new file mode 100644
index 00000000000..c70299b8523
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.cpp
@@ -0,0 +1,125 @@
+#include "ServerInterceptor.h"
+#include <tao/PI_Server/ServerRequestInfoA.h>
+#include <tao/OctetSeqC.h>
+#include <iostream>
+
+const IOP::ServiceId service_id = 0xdeed;
+const CORBA::Long allowed_gid[4] = { 9006, 9007, 9008 };
+const char* restricted_interfaces[1] = {"IDL:Messenger:1.0"};
+
+ServerInterceptor::ServerInterceptor (IOP::CodecFactory_var cf)
+ : myname_ ("Server_Authentication_Interceptor")
+{
+ std::cout << "Calling ServerInterceptor constructor." << std::endl;
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ this->codec = cf->create_codec (encoding);
+}
+
+ServerInterceptor::~ServerInterceptor ()
+{
+}
+
+char *
+ServerInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ServerInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ServerInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling destroy()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_request_service_contexts()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ bool permission_granted = false;
+ std::cout << "Calling receive_request()." << std::endl;
+
+ if (ri->target_is_a(restricted_interfaces[0])){
+ IOP::ServiceId id = service_id;
+ // Check that the request service context can be retrieved.
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+ // need to construct an octet seq for decoding
+ CORBA::OctetSeq ocSeq = CORBA::OctetSeq(
+ sc->context_data.length(),
+ sc->context_data.length(),
+ sc->context_data.get_buffer(),
+ 0);
+
+ CORBA::Any gid_as_any;
+ gid_as_any = *codec->decode(ocSeq);
+
+ CORBA::Long gid;
+ gid_as_any >>= gid;
+ for (int i=0; i<3; ++i) {
+ if ( gid == allowed_gid[i] )
+ {
+ permission_granted = true;
+ }
+ }
+ }
+
+ if (permission_granted == true) {
+ std::cout << "Permission Granted " << std::endl;
+ }
+ else {
+ std::cout << "Permission Denied " << std::endl;
+ ACE_THROW_SPEC (CORBA::NO_PERMISSION());
+ }
+}
+
+void
+ServerInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_reply()." << std::endl;
+}
+
+void
+ServerInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_exception()." << std::endl;
+}
+
+void
+ServerInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_other()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.h
new file mode 100644
index 00000000000..abcac4bc9f5
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerInterceptor.h
@@ -0,0 +1,47 @@
+#ifndef SERVERINTERCEPTOR_H
+#define SERVERINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/ServerRequestInterceptorA.h"
+#include "tao/PI/ORBInitInfo.h"
+
+class ServerInterceptor
+: public PortableInterceptor::ServerRequestInterceptor
+{
+ public:
+ ServerInterceptor (IOP::CodecFactory_var);
+
+ ~ServerInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+ IOP::Codec_var codec;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/IOR/run_test.pl b/TAO/DevGuideExamples/PortableInterceptors/IOR/run_test.pl
new file mode 100644
index 00000000000..2bd452196e4
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/IOR/run_test.pl
@@ -0,0 +1,37 @@
+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;
+
+# start MessengerServer
+my($iorfile) = 'Messenger.ior';
+unlink $iorfile;
+
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed (
+ $iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill();
+ exit(1);
+}
+
+# start MessengerClient
+select undef, undef, undef, .5;
+$C = new PerlACE::Process("MessengerClient");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+
+unlink $iorfile;
+
+exit 0;
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.cpp
new file mode 100644
index 00000000000..0b81911048d
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.cpp
@@ -0,0 +1,56 @@
+#include "ClientInitializer.h"
+#include "ClientInterceptor.h"
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+ClientInitializer::ClientInitializer (void)
+ : slot_ (0),
+ current_ (PortableInterceptor::Current::_nil())
+{
+}
+
+void
+ClientInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+void
+ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
+{
+ // resolve Messenger object
+ CORBA::Object_var obj = info->resolve_initial_references( "Messenger" );
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ ACE_ASSERT(false);
+ }
+
+ // allocate slot
+ slot_ = info->allocate_slot_id();
+
+ // get PICurrent
+ CORBA::Object_var current_obj = info->resolve_initial_references("PICurrent");
+
+ current_ =
+ PortableInterceptor::Current::_narrow(current_obj.in());
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ClientRequestInterceptor_var ci =
+ new ClientInterceptor(messenger, current_.in(), slot_);
+ info->add_client_request_interceptor (ci.in());
+}
+
+void
+ClientInitializer::set_slot_data (void)
+{
+ // Set the recursion flag
+ CORBA::Any flag;
+ CORBA::Boolean x = 0;
+ flag <<= CORBA::Any::from_boolean(x);
+ current_->set_slot(slot_, flag);
+
+ // Now that we're done with the PICurrent, we will release
+ // our reference to it.
+ current_ = PortableInterceptor::Current::_nil();
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.h
new file mode 100644
index 00000000000..33131f3c1cc
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInitializer.h
@@ -0,0 +1,25 @@
+#ifndef CLIENTINITIALIZER_H
+#define CLIENTINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+#include "tao/PI/PICurrentC.h"
+
+class ClientInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+ public:
+ ClientInitializer (void);
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+ void set_slot_data (void);
+
+ private:
+ PortableInterceptor::SlotId slot_;
+ PortableInterceptor::Current_var current_;
+};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
new file mode 100644
index 00000000000..52454103c10
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
@@ -0,0 +1,109 @@
+#include "ClientInterceptor.h"
+#include "tao/OctetSeqC.h"
+#include "tao/PI/ClientRequestInfo.h"
+#include "MessengerC.h"
+#include "ace/OS_NS_string.h"
+#include <iostream>
+
+const CORBA::ULong service_ctx_id = 0xdeed;
+
+ClientInterceptor::
+ClientInterceptor (Messenger_var theMessenger,
+ PortableInterceptor::Current_ptr thePic,
+ PortableInterceptor::SlotId theSlot)
+ : myname_ ("Client_Authentication_Interceptor")
+{
+ std::cout << "Calling ClientInterceptor constructor." << std::endl;
+ this->messenger = theMessenger;
+ this->pic = thePic;
+ this->slot = theSlot;
+}
+
+ClientInterceptor::~ClientInterceptor (void)
+{
+}
+
+char *
+ClientInterceptor::name ()
+{
+ std::cout << "Calling ClientInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ClientInterceptor::destroy ()
+{
+}
+
+void
+ClientInterceptor::send_poll (PortableInterceptor::ClientRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_poll()." << std::endl;
+}
+
+
+void
+ClientInterceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
+{
+ std::cout << "Calling send_request()." << std::endl;
+
+ IOP::ServiceContext sc;
+ sc.context_id = service_ctx_id;
+
+ const char user_name[] = "Ron Klein";
+ std::cout << "User's Name: " << user_name << std::endl;
+ CORBA::ULong string_len = sizeof (user_name) + 1;
+ CORBA::Octet *buf = 0;
+ buf = new CORBA::Octet [string_len];
+
+ ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
+
+ sc.context_data.replace (string_len, string_len, buf, 1);
+
+ // recursive call setup
+ CORBA::Any *recurse = ri->get_slot(slot);
+ CORBA::Boolean x;
+ *recurse >>= CORBA::Any::to_boolean(x);
+
+ CORBA::Any flag;
+ if (x == 0)
+ {
+ x = 1;
+ flag <<= CORBA::Any::from_boolean(x);
+
+ pic->set_slot(slot, flag);
+
+ // get server time
+ std::cout << "Server Time = " << messenger->get_time() << std::endl;
+ }
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc, 0);
+
+ // reset recursion test
+ x = 0;
+ flag <<= CORBA::Any::from_boolean(x);
+ pic->set_slot(slot,flag);
+
+}
+
+void
+ClientInterceptor::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_reply()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_other()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_exception()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.h
new file mode 100644
index 00000000000..538460c6e71
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.h
@@ -0,0 +1,43 @@
+#ifndef CLIENTINTERCEPTOR_H
+#define CLIENTINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/ClientRequestInterceptorA.h"
+#include "tao/PI/PICurrentC.h"
+#include "MessengerC.h"
+
+class ClientInterceptor:
+ public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+
+ public:
+ ClientInterceptor (Messenger_var theMessage,
+ PortableInterceptor::Current_ptr thePic,
+ PortableInterceptor::SlotId theSlot);
+
+ virtual ~ClientInterceptor ();
+
+ virtual char * name ();
+
+ virtual void destroy ();
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri);
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri);
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri);
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri);
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri);
+
+ private:
+ const char *myname_;
+ Messenger_var messenger;
+ PortableInterceptor::Current_ptr pic;
+ PortableInterceptor::SlotId slot;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger.idl b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger.idl
new file mode 100644
index 00000000000..ceda3e3e52b
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger.idl
@@ -0,0 +1,10 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+
+ string get_time ();
+ };
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerClient.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerClient.cpp
new file mode 100644
index 00000000000..f5115a69efb
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerClient.cpp
@@ -0,0 +1,52 @@
+#include "MessengerC.h"
+#include "ClientInitializer.h"
+
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI library is linked in when building statically
+#include <tao/PI/PI.h>
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ ClientInitializer* temp_initializer = new ClientInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "Client ORB");
+
+ // Now that the ORB is initialized (and subsequently the
+ // PICurrent), we can set the slot data on the PICurrent for our
+ // interceptor initializer.
+ temp_initializer->set_slot_data ();
+
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if ( CORBA::is_nil(obj.in() ) ) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "client Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerServer.cpp
new file mode 100644
index 00000000000..ef2f97614c1
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/MessengerServer.cpp
@@ -0,0 +1,63 @@
+#include "Messenger_i.h"
+#include "MessengerS.h"
+#include "ServerInitializer.h"
+
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI_Server library is linked in when building statically
+#include <tao/PI_Server/PI_Server.h>
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+#include <fstream>
+#include <fstream>
+
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ ServerInitializer *temp_initializer = 0;
+
+ temp_initializer = new ServerInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB");
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile ( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << std::endl << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "server Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.cpp
new file mode 100644
index 00000000000..866a54c890f
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.cpp
@@ -0,0 +1,51 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/OS_NS_time.h>
+#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+
+{
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+}
+
+char * Messenger_i::get_time (void)
+{
+ time_t thetime;
+ struct tm * timeinfo = 0;
+
+ ACE_OS::time(&thetime);
+ timeinfo = ACE_OS::localtime(&thetime);
+ char *timestring = CORBA::string_dup(ACE_OS::asctime(timeinfo));
+
+ return timestring;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.h
new file mode 100644
index 00000000000..c1f0e3daa84
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/Messenger_i.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+
+ virtual char * get_time (void);
+};
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/PICurrent.mpc b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/PICurrent.mpc
new file mode 100644
index 00000000000..53d7b4c1085
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/PICurrent.mpc
@@ -0,0 +1,17 @@
+project(*Server): taoexe, portableserver, pi_server, namingexe {
+ Source_Files {
+ Messenger_i.cpp
+ ServerInitializer.cpp
+ ServerInterceptor.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, pi, namingexe, interceptors {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ ClientInitializer.cpp
+ ClientInterceptor.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/README b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/README
new file mode 100644
index 00000000000..89211ca7106
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/README
@@ -0,0 +1,34 @@
+Portable Interceptors
+
+
+File: DevGuideExamples/PortableInterceptor/PICurrent_NameService/README
+
+
+This directory contains an example that shows how the PICurrent can
+be used to stop client-side interceptor recursions.
+
+This example is based on the Messenger example in GettingStarted
+directory. A message is send by MessengerClient and displayed by
+MessengerServer. When the client receives a reply, it asks the server
+for the current time. This causes a recursive call at the receive_reply()
+interception point. A flag is passed in the PICurrent to let the client
+know the call is recursive.
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+To start the client:
+------------------
+./MessengerClient -ORBInitRef Messenger=file://Messenger.ior
+
+Execuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.cpp
new file mode 100644
index 00000000000..fc609c531c5
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.cpp
@@ -0,0 +1,22 @@
+#include "ServerInitializer.h"
+#include "ServerInterceptor.h"
+
+ServerInitializer::ServerInitializer ()
+{
+}
+
+void
+ServerInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+void
+ServerInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+{
+ // Create and register the request interceptors.
+ PortableInterceptor::ServerRequestInterceptor_var si =
+ new ServerInterceptor();
+ info->add_server_request_interceptor (si.in());
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.h
new file mode 100644
index 00000000000..fb880e8b5f4
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInitializer.h
@@ -0,0 +1,21 @@
+#ifndef SERVERINITIALIZER_H
+#define SERVERINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI/PI.h"
+
+class ServerInitializer :
+public virtual PortableInterceptor::ORBInitializer
+{
+ public:
+ ServerInitializer ();
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+ private:
+ int interceptor_type_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.cpp
new file mode 100644
index 00000000000..8dfb951ba97
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.cpp
@@ -0,0 +1,98 @@
+#include "ServerInterceptor.h"
+#include "tao/PI_Server/ServerRequestInfoA.h"
+#include "ace/OS_NS_string.h"
+#include <iostream>
+
+const IOP::ServiceId service_id = 0xdeed;
+const unsigned int num_allowed_users = 4;
+static const char* allowed_users[num_allowed_users+1] =
+ {"Ron Klein", "Scott Case", "Mark Hodge", "Greg Black", 0};
+const char* restricted_interfaces[1] = {"IDL:Messenger:1.0"};
+
+ServerInterceptor::ServerInterceptor (void)
+ : myname_ ("Server_Authentication_Interceptor")
+{
+ std::cout << "Calling ServerInterceptor constructor." << std::endl;
+}
+
+ServerInterceptor::~ServerInterceptor ()
+{
+}
+
+char *
+ServerInterceptor::name ()
+{
+ std::cout << "Calling ServerInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ServerInterceptor::destroy ()
+{
+ std::cout << "Calling destroy()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_request_service_contexts()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ bool permission_granted = false;
+ std::cout << "Calling receive_request()." << std::endl;
+
+ if (ri->target_is_a(restricted_interfaces[0])){
+ IOP::ServiceId id = service_id;
+ // Check that the request service context can be retrieved.
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+
+ CORBA::OctetSeq ocSeq = sc->context_data;
+
+ const char * buf =
+ reinterpret_cast<const char *> (ocSeq.get_buffer ());
+
+ for (unsigned int i=0; i<num_allowed_users; ++i) {
+ if (ACE_OS::strcmp (buf, allowed_users[i]) == 0)
+ {
+ permission_granted = true;
+ }
+ }
+ }
+
+ if (permission_granted == true) {
+ std::cout << "Permission Granted " << std::endl;
+ }
+ else {
+ std::cout << "Permission Denied " << std::endl;
+ ACE_THROW_SPEC (CORBA::NO_PERMISSION());
+ }
+}
+
+void
+ServerInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_reply()." << std::endl;
+}
+
+void
+ServerInterceptor::send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_exception()." << std::endl;
+}
+
+void
+ServerInterceptor::send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_other()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.h
new file mode 100644
index 00000000000..a8da1affe95
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ServerInterceptor.h
@@ -0,0 +1,34 @@
+#ifndef SERVERINTERCEPTOR_H
+#define SERVERINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/ServerRequestInterceptorA.h"
+
+class ServerInterceptor
+: public PortableInterceptor::ServerRequestInterceptor
+{
+ public:
+ ServerInterceptor (void);
+
+ ~ServerInterceptor ();
+
+ virtual char * name ();
+
+ virtual void destroy ();
+
+ virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ private:
+ const char *myname_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/run_test.pl b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/run_test.pl
new file mode 100644
index 00000000000..d31c1b8a2f5
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/run_test.pl
@@ -0,0 +1,37 @@
+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;
+
+$ior = "Messenger.ior";
+unlink $ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $ior\n";
+ $S->Kill();
+ exit 1;
+}
+
+# start MessengerClient
+select undef, undef, undef, .5;
+$C = new PerlACE::Process("MessengerClient", " -ORBInitRef Messenger=file://$ior");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+#unlink $ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp
new file mode 100644
index 00000000000..920ab847cf4
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.cpp
@@ -0,0 +1,70 @@
+#include "ClientInitializer.h"
+#include "ClientInterceptor.h"
+#include "MessengerC.h"
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+
+ClientInitializer::ClientInitializer (void)
+ : slot_ (0),
+ current_ (PortableInterceptor::Current::_nil())
+{
+}
+
+void
+ClientInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+void
+ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
+{
+ // Find the Naming Service
+ CORBA::Object_var naming_obj =
+ info->resolve_initial_references("NameService");
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow(naming_obj.in());
+ if( CORBA::is_nil(root.in())) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ ACE_ASSERT(false);
+ }
+
+ // Resolve the Messenger object
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup( "Messenger" );
+ CORBA::Object_var obj = root->resolve( name );
+
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ ACE_ASSERT(false);
+ }
+
+ // allocate slot
+ slot_ = info->allocate_slot_id();
+
+ // get PICurrent
+ CORBA::Object_var current_obj = info->resolve_initial_references("PICurrent");
+
+ current_ =
+ PortableInterceptor::Current::_narrow(current_obj.in());
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ClientRequestInterceptor_var ci =
+ new ClientInterceptor(messenger, current_.in(), slot_);
+ info->add_client_request_interceptor (ci.in());
+}
+
+void
+ClientInitializer::set_slot_data (void)
+{
+ // Set the recursion flag
+ CORBA::Any flag;
+ CORBA::Boolean x = 0;
+ flag <<= CORBA::Any::from_boolean(x);
+ current_->set_slot(slot_, flag);
+
+ // Now that we're done with the PICurrent, we will release
+ // our reference to it.
+ current_ = PortableInterceptor::Current::_nil();
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.h
new file mode 100644
index 00000000000..33131f3c1cc
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInitializer.h
@@ -0,0 +1,25 @@
+#ifndef CLIENTINITIALIZER_H
+#define CLIENTINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+#include "tao/PI/PICurrentC.h"
+
+class ClientInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+ public:
+ ClientInitializer (void);
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+ void set_slot_data (void);
+
+ private:
+ PortableInterceptor::SlotId slot_;
+ PortableInterceptor::Current_var current_;
+};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp
new file mode 100644
index 00000000000..77792427eba
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.cpp
@@ -0,0 +1,124 @@
+#include "ClientInterceptor.h"
+#include "tao/OctetSeqC.h"
+#include "tao/PI/ClientRequestInfo.h"
+#include "MessengerC.h"
+#include "ace/OS_NS_string.h"
+#include <iostream>
+
+const CORBA::ULong service_ctx_id = 0xdeed;
+
+ClientInterceptor::
+ClientInterceptor (Messenger_var theMessenger,
+ PortableInterceptor::Current_ptr thePic,
+ PortableInterceptor::SlotId theSlot)
+ : myname_ ("Client_Authentication_Interceptor")
+{
+ std::cout << "Calling ClientInterceptor constructor." << std::endl;
+ this->messenger = theMessenger;
+ this->pic = thePic;
+ this->slot = theSlot;
+}
+
+ClientInterceptor::~ClientInterceptor (void)
+{
+}
+
+char *
+ClientInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ClientInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ClientInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInterceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_poll()." << std::endl;
+}
+
+
+void
+ClientInterceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling send_request()." << std::endl;
+
+ IOP::ServiceContext sc;
+ sc.context_id = service_ctx_id;
+
+ const char user_name[] = "Ron Klein";
+ std::cout << "User's Name: " << user_name << std::endl;
+ CORBA::ULong string_len = sizeof (user_name) + 1;
+ CORBA::Octet *buf = 0;
+ buf = new CORBA::Octet [string_len];
+
+ ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
+
+ sc.context_data.replace (string_len, string_len, buf, 1);
+
+ // recursive call setup
+ CORBA::Any *recurse = ri->get_slot(slot);
+ CORBA::Long x;
+ *recurse >>= x;
+
+ CORBA::Any flag;
+ if (x == 0)
+ {
+ flag <<= 1;
+
+ pic->set_slot(slot, flag);
+
+ // get server time
+ std::cout << "Server Time = " << messenger->get_time() << std::endl;
+ }
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc, 0);
+
+ // reset recursion test
+ flag <<= 0;
+ pic->set_slot(slot,flag);
+
+}
+
+void
+ClientInterceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_reply()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_other()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_exception()." << std::endl;
+}
+
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.h
new file mode 100644
index 00000000000..c65e5f0c6df
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ClientInterceptor.h
@@ -0,0 +1,53 @@
+#ifndef CLIENTINTERCEPTOR_H
+#define CLIENTINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/ClientRequestInterceptorA.h"
+#include "tao/PI/PICurrentC.h"
+#include "MessengerC.h"
+
+class ClientInterceptor:
+ public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+
+ public:
+ ClientInterceptor (Messenger_var theMessage,
+ PortableInterceptor::Current_ptr thePic,
+ PortableInterceptor::SlotId theSlot);
+
+ virtual ~ClientInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+ Messenger_var messenger;
+ PortableInterceptor::Current_ptr pic;
+ PortableInterceptor::SlotId slot;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger.idl b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger.idl
new file mode 100644
index 00000000000..ceda3e3e52b
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger.idl
@@ -0,0 +1,10 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+
+ string get_time ();
+ };
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerClient.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerClient.cpp
new file mode 100644
index 00000000000..6e2128ba16c
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerClient.cpp
@@ -0,0 +1,62 @@
+#include "MessengerC.h"
+#include "ClientInitializer.h"
+
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI library is linked in when building statically
+#include <tao/PI/PI.h>
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ ClientInitializer* temp_initializer = new ClientInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "Client ORB");
+
+ // Now that the ORB is initialized (and subsequently the
+ // PICurrent), we can set the slot data on the PICurrent for our
+ // interceptor initializer.
+ temp_initializer->set_slot_data ();
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references( "NameService" );
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow( naming_obj.in() );
+ if ( CORBA::is_nil(root.in() ) ) {
+ std::cerr << "Couldn't find Naming Service." << std::endl;
+ return 1;
+ }
+
+ // get Messenger
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id = CORBA::string_dup( "Messenger" );
+
+ CORBA::Object_var obj = root->resolve( name );
+
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerServer.cpp
new file mode 100644
index 00000000000..6f7c1f7c21e
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/MessengerServer.cpp
@@ -0,0 +1,72 @@
+#include "Messenger_i.h"
+#include "MessengerS.h"
+#include "ServerInitializer.h"
+
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI_Server library is linked in when building statically
+#include <tao/PI_Server/PI_Server.h>
+#include <orbsvcs/CosNamingC.h>
+#include <iostream>
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ ServerInitializer *temp_initializer = 0;
+ temp_initializer = new ServerInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB");
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Find the Naming Service
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references( "NameService" );
+ CosNaming::NamingContext_var root =
+ CosNaming::NamingContext::_narrow( naming_obj.in() );
+ if( CORBA::is_nil( root.in() ) ) {
+ std::cerr << "Nil Naming Context reference" << std::endl;
+ return 1;
+ }
+
+ // Bind Messenger
+ CosNaming::Name name;
+ name.length( 1 );
+ name[0].id = CORBA::string_dup( "Messenger" );
+
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ root->rebind(name, messenger_obj.in());
+
+ std::cout << "Messenger bound in Naming Service" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.cpp
new file mode 100644
index 00000000000..b69a42ab285
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.cpp
@@ -0,0 +1,61 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <ace/OS_NS_time.h>
+#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+ {
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+ }
+
+char * Messenger_i::get_time (
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ time_t thetime;
+ struct tm * timeinfo;
+
+ ACE_OS::time(&thetime);
+ timeinfo = ACE_OS::localtime(&thetime);
+ char *timestring = CORBA::string_dup(ACE_OS::asctime(timeinfo));
+
+ return timestring;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.h
new file mode 100644
index 00000000000..46135bf7dd9
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/Messenger_i.h
@@ -0,0 +1,47 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+virtual char * get_time (
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+};
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc
new file mode 100644
index 00000000000..eefa89004eb
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/PICurrent_NameService.mpc
@@ -0,0 +1,17 @@
+project(*Server): taoexe, portableserver, namingexe, pi_server, avoids_minimum_corba {
+ Source_Files {
+ Messenger_i.cpp
+ ServerInitializer.cpp
+ ServerInterceptor.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, namingexe, pi, avoids_minimum_corba, interceptors {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ ClientInitializer.cpp
+ ClientInterceptor.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/README b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/README
new file mode 100644
index 00000000000..04a008c682e
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/README
@@ -0,0 +1,42 @@
+Portable Interceptors
+
+
+File: DevGuideExamples/PortableInterceptor/PICurrent_NameService/README
+
+
+This directory contains an example that shows how the PICurrent can
+be used to stop client-side interceptor recursions. This example is
+identical to the ../PICurrent example but uses the Naming Service.
+
+This example is based on the Messenger example in GettingStarted
+directory. A message is send by MessengerClient and displayed by
+MessengerServer. When the client receives a reply, it asks the server
+for the current time. This causes a recursive call at the receive_reply()
+interception point. A flag is passed in the PICurrent to let the client
+know the call is recursive.
+
+How to Run
+----------
+
+Start the Naming Service:
+-------------------------
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service \
+ -ORBEndpoint iiop://localhost:9876
+
+To start the server:
+------------------
+./MessengerServer \
+ -ORBInitRef NameService=iioploc://localhost:9876/NameService
+
+To start the client:
+------------------
+./MessengerClient \
+ -ORBInitRef NameService=iioploc://localhost:9876/NameService
+
+Execution via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.cpp
new file mode 100644
index 00000000000..4ead54b7746
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.cpp
@@ -0,0 +1,24 @@
+#include "ServerInitializer.h"
+#include "ServerInterceptor.h"
+
+ServerInitializer::ServerInitializer ()
+{
+}
+
+void
+ServerInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Create and register the request interceptors.
+ PortableInterceptor::ServerRequestInterceptor_var si =
+ new ServerInterceptor();
+ info->add_server_request_interceptor (si.in());
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.h
new file mode 100644
index 00000000000..f07b7821cb2
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInitializer.h
@@ -0,0 +1,23 @@
+#ifndef SERVERINITIALIZER_H
+#define SERVERINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI/PI.h"
+
+class ServerInitializer :
+public virtual PortableInterceptor::ORBInitializer
+{
+ public:
+ ServerInitializer ();
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ int interceptor_type_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp
new file mode 100644
index 00000000000..db1004b8a2f
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.cpp
@@ -0,0 +1,112 @@
+#include "ServerInterceptor.h"
+#include "tao/PI_Server/ServerRequestInfoA.h"
+#include "ace/OS_NS_string.h"
+#include <iostream>
+
+const IOP::ServiceId service_id = 0xdeed;
+const unsigned int num_allowed_users = 4;
+static const char* allowed_users[num_allowed_users+1] =
+ {"Ron Klein", "Scott Case", "Mark Hodge", "Greg Black", 0};
+const char* restricted_interfaces[1] = {"IDL:Messenger:1.0"};
+
+ServerInterceptor::ServerInterceptor (void)
+ : myname_ ("Server_Authentication_Interceptor")
+{
+ std::cout << "Calling ServerInterceptor constructor." << std::endl;
+}
+
+ServerInterceptor::~ServerInterceptor ()
+{
+}
+
+char *
+ServerInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ServerInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ServerInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling destroy()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_request_service_contexts()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ bool permission_granted = false;
+ std::cout << "Calling receive_request()." << std::endl;
+
+ if (ri->target_is_a(restricted_interfaces[0])){
+ IOP::ServiceId id = service_id;
+ // Check that the request service context can be retrieved.
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+
+ CORBA::OctetSeq ocSeq = sc->context_data;
+
+ const char * buf =
+ reinterpret_cast<const char *> (ocSeq.get_buffer ());
+
+ for (unsigned int i=0; i<num_allowed_users; ++i) {
+ if (ACE_OS::strcmp (buf, allowed_users[i]) == 0)
+ {
+ permission_granted = true;
+ }
+ }
+ }
+
+ if (permission_granted == true) {
+ std::cout << "Permission Granted " << std::endl;
+ }
+ else {
+ std::cout << "Permission Denied " << std::endl;
+ ACE_THROW_SPEC (CORBA::NO_PERMISSION());
+ }
+}
+
+void
+ServerInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_reply()." << std::endl;
+}
+
+void
+ServerInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_exception()." << std::endl;
+}
+
+void
+ServerInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_other()." << std::endl;
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.h
new file mode 100644
index 00000000000..d0eb11ee704
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/ServerInterceptor.h
@@ -0,0 +1,45 @@
+#ifndef SERVERINTERCEPTOR_H
+#define SERVERINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/ServerRequestInterceptorA.h"
+
+class ServerInterceptor
+: public PortableInterceptor::ServerRequestInterceptor
+{
+ public:
+ ServerInterceptor (void);
+
+ ~ServerInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl
new file mode 100644
index 00000000000..4664541b8a4
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl
@@ -0,0 +1,46 @@
+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;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+unlink $nsiorfile;
+$PORT=9876;
+
+# start Naming Service
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile -ORBEndpoint iiop://localhost:$PORT");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file $nsiorfile\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start MessengerServer
+$IREF = "-ORBInitRef NameService=iioploc://localhost:$PORT/NameService";
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer", $IREF);
+$S->Spawn();
+
+# start MessengerClient
+sleep(1);
+$C = new PerlACE::Process("MessengerClient", $IREF);
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ $NS->Kill();
+ exit(1);
+}
+# clean-up
+
+$S->Kill();
+$NS->Kill();
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.cpp
new file mode 100644
index 00000000000..8049968e6e6
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.cpp
@@ -0,0 +1,31 @@
+#include "ClientInitializer.h"
+#include "ClientInterceptor.h"
+
+ClientInitializer::ClientInitializer (void)
+{
+}
+
+void
+ClientInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ // get Codec factory
+ IOP::CodecFactory_var codec_factory = info->codec_factory();
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ClientRequestInterceptor_var ci =
+ new ClientInterceptor (codec_factory);
+ info->add_client_request_interceptor (ci.in());
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.h
new file mode 100644
index 00000000000..9536c6ce776
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInitializer.h
@@ -0,0 +1,21 @@
+#ifndef CLIENTINITIALIZER_H
+#define CLIENTINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+
+class ClientInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+ public:
+ ClientInitializer (void);
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.cpp
new file mode 100644
index 00000000000..16112bba847
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.cpp
@@ -0,0 +1,106 @@
+#include "ClientInterceptor.h"
+#include "tao/OctetSeqC.h"
+#include "tao/PI/ClientRequestInfo.h"
+#include <iostream>
+
+const CORBA::ULong service_ctx_id = 0xdeed;
+
+ClientInterceptor::
+ClientInterceptor (IOP::CodecFactory_var cf)
+ : myname_ ("Client_Authentication_Interceptor")
+{
+ std::cout << "Calling ClientInterceptor constructor." << std::endl;
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ this->codec = cf->create_codec (encoding);
+
+}
+
+ClientInterceptor::~ClientInterceptor (void)
+{
+}
+
+char *
+ClientInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ClientInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ClientInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ClientInterceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_poll()." << std::endl;
+}
+
+
+void
+ClientInterceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling send_request()." << std::endl;
+
+ IOP::ServiceContext sc;
+ sc.context_id = service_ctx_id;
+
+ const CORBA::Long gid = 9007;
+ std::cout << "GID: " << gid << std::endl;
+
+ CORBA::Any gid_as_any;
+ gid_as_any <<= gid;
+
+ sc.context_data = reinterpret_cast<CORBA::OctetSeq&> (
+ *codec->encode(gid_as_any));
+
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc, 0);
+
+}
+
+void
+ClientInterceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_reply()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_other()." << std::endl;
+}
+
+void
+ClientInterceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling receive_exception()." << std::endl;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.h
new file mode 100644
index 00000000000..a8bed32eb50
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ClientInterceptor.h
@@ -0,0 +1,49 @@
+#ifndef CLIENTINTERCEPTOR_H
+#define CLIENTINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/PI/ClientRequestInterceptorA.h"
+#include "tao/PI/ORBInitInfo.h"
+
+class ClientInterceptor:
+ public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+
+ public:
+ ClientInterceptor (IOP::CodecFactory_var) ;
+
+ virtual ~ClientInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+ IOP::Codec_var codec;
+
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger.idl b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger.idl
new file mode 100644
index 00000000000..f2a0074c1e8
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger.idl
@@ -0,0 +1,6 @@
+#include "orb.idl"
+
+interface Messenger
+{
+ void send_message(in CORBA::OctetSeq user_name);
+};
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerClient.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerClient.cpp
new file mode 100644
index 00000000000..3ee545b3f3a
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerClient.cpp
@@ -0,0 +1,85 @@
+#include "MessengerC.h"
+#include "ClientInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI library is linked in when building statically
+#include <tao/PI/PI.h>
+#include <iostream>
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ temp_initializer = new ClientInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Destringify ior
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Obtain a reference to the CodecFactory.
+ CORBA::Object_var obj2 =
+ orb->resolve_initial_references ("CodecFactory");
+
+ IOP::CodecFactory_var codec_factory;
+
+ if(CORBA::is_nil(obj2.in()))
+ {
+ std::cerr << "Error: codec_factory" << std::endl;
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow (obj2.in ());
+ std::cout << "got codec factory" << std::endl;
+ }
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ IOP::Codec_var codec =
+ codec_factory->create_codec (encoding);
+
+ CORBA::Long uid = 64321;
+
+ CORBA::Any uid_as_any;
+
+ uid_as_any <<= uid;
+ CORBA::OctetSeq client_uid = *codec->encode (uid_as_any);
+ messenger->send_message( client_uid );
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Exception in MessengerClient: " << ex << std::endl;
+ return 1;
+ }
+
+ std::cout << "Message was sent" << std::endl;
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
new file mode 100644
index 00000000000..43be05f3d32
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
@@ -0,0 +1,61 @@
+#include "Messenger_i.h"
+#include "MessengerC.h"
+#include "ServerInitializer.h"
+#include <tao/ORBInitializer_Registry.h>
+// Ensure that the PI_Server library is linked in when building statically
+#include <tao/PI_Server/PI_Server.h>
+#include <iostream>
+#include <fstream>
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ ServerInitializer *temp_initializer = 0;
+
+ temp_initializer = new ServerInitializer;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex)
+ {
+ std::cerr << "Exception in MessengerServer: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.cpp
new file mode 100644
index 00000000000..995ce6f626e
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.cpp
@@ -0,0 +1,74 @@
+#include "Messenger_i.h"
+#include <ace/OS_NS_string.h>
+#include <tao/CodecFactory/CodecFactory.h>
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+
+void Messenger_i::send_message (const CORBA::OctetSeq & user_name)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ try
+ {
+ int argc = 1;
+ char **argv = new char *[argc];
+ argv[0] = new char[ACE_OS::strlen ("MessengerServer")];
+ strcpy (argv[0], "MessengerServer");
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ // Obtain a reference to the CodecFactory.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("CodecFactory");
+
+ IOP::CodecFactory_var codec_factory;
+
+ if(CORBA::is_nil(obj.in()))
+ {
+ std::cerr << "Error: codec_factory" << std::endl;
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow (obj.in ());
+ std::cout << "Server got codec factory" << std::endl;
+ }
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ IOP::Codec_var codec =
+ codec_factory->create_codec (encoding);
+
+ CORBA::Any uid_as_any;
+ uid_as_any = *(codec->decode(user_name));
+
+ CORBA::Long uid;
+ uid_as_any >>= uid;
+ std::cout << "UID: " << uid << std::endl;
+
+ }
+ catch(...)
+ {
+ std::cerr << "exception received" << std::endl;
+ ACE_OS::exit(1);
+ }
+
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.h b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.h
new file mode 100644
index 00000000000..fac0e58921c
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/Messenger_i.h
@@ -0,0 +1,28 @@
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+ public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+
+ virtual void send_message (const CORBA::OctetSeq & user_name)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+};
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/README b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/README
new file mode 100644
index 00000000000..2300d5ad16f
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/README
@@ -0,0 +1,36 @@
+Portable Interceptors
+
+
+File: DevGuideExamples/PortableInterceptor/SimpleCodec/README
+
+
+This directory contains an example illustrating marshaling of data in
+client and server Request Interceptors.
+
+This example extends the authentication example in ../Auth. It is based on
+the Messenger example in GettingStarted directory. A message is
+sent by MessengerClient and displayed by MessengerServer. A client-side
+portable interceptor adds an encoded (marshaled) GID to each request
+sent to the server. A server-side interceptor verifies that the supplied
+GID is valid.
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
+
+
+Execution via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.cpp
new file mode 100644
index 00000000000..066634498f6
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.cpp
@@ -0,0 +1,27 @@
+#include "ServerInitializer.h"
+#include "ServerInterceptor.h"
+
+ServerInitializer::ServerInitializer ()
+{
+}
+
+void
+ServerInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // get reference to the codec_factory
+ IOP::CodecFactory_var codec_factory = info->codec_factory();
+
+ // Create and register the request interceptors.
+ PortableInterceptor::ServerRequestInterceptor_var si =
+ new ServerInterceptor (codec_factory);
+ info->add_server_request_interceptor (si.in());
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.h b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.h
new file mode 100644
index 00000000000..f07b7821cb2
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInitializer.h
@@ -0,0 +1,23 @@
+#ifndef SERVERINITIALIZER_H
+#define SERVERINITIALIZER_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI/PI.h"
+
+class ServerInitializer :
+public virtual PortableInterceptor::ORBInitializer
+{
+ public:
+ ServerInitializer ();
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ int interceptor_type_;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.cpp
new file mode 100644
index 00000000000..08ddc68dca7
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.cpp
@@ -0,0 +1,126 @@
+#include "ServerInterceptor.h"
+#include <tao/PI_Server/ServerRequestInfoA.h>
+#include <tao/OctetSeqC.h>
+#include <iostream>
+
+const IOP::ServiceId service_id = 0xdeed;
+const CORBA::Long allowed_gid[4] = { 9006, 9007, 9008 };
+const char* restricted_interfaces[1] = {"IDL:Messenger:1.0"};
+
+ServerInterceptor::ServerInterceptor (IOP::CodecFactory_var cf)
+ : myname_ ("Server_Authentication_Interceptor")
+{
+ std::cout << "Calling ServerInterceptor constructor." << std::endl;
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.2 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Obtain the CDR encapsulation Codec.
+ this->codec = cf->create_codec (encoding);
+
+}
+
+ServerInterceptor::~ServerInterceptor ()
+{
+}
+
+char *
+ServerInterceptor::name ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling ServerInterceptor name() method" << std::endl;
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+ServerInterceptor::destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ std::cout << "Calling destroy()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ std::cout << "Calling receive_request_service_contexts()." << std::endl;
+}
+
+void
+ServerInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ bool permission_granted = false;
+ std::cout << "Calling receive_request()." << std::endl;
+
+ if (ri->target_is_a(restricted_interfaces[0])){
+ IOP::ServiceId id = service_id;
+ // Check that the request service context can be retrieved.
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (id);
+ // need to construct an octet seq for decoding
+ CORBA::OctetSeq ocSeq = CORBA::OctetSeq(
+ sc->context_data.length(),
+ sc->context_data.length(),
+ sc->context_data.get_buffer(),
+ 0);
+
+ CORBA::Any gid_as_any;
+ gid_as_any = *codec->decode(ocSeq);
+
+ CORBA::Long gid;
+ gid_as_any >>= gid;
+ for (int i=0; i<3; ++i) {
+ if ( gid == allowed_gid[i] )
+ {
+ permission_granted = true;
+ }
+ }
+ }
+
+ if (permission_granted == true) {
+ std::cout << "Permission Granted " << std::endl;
+ }
+ else {
+ std::cout << "Permission Denied " << std::endl;
+ ACE_THROW_SPEC (CORBA::NO_PERMISSION());
+ }
+}
+
+void
+ServerInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_reply()." << std::endl;
+}
+
+void
+ServerInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_exception()." << std::endl;
+}
+
+void
+ServerInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ std::cout << "Calling send_other()." << std::endl;
+}
+
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.h b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.h
new file mode 100644
index 00000000000..abcac4bc9f5
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/ServerInterceptor.h
@@ -0,0 +1,47 @@
+#ifndef SERVERINTERCEPTOR_H
+#define SERVERINTERCEPTOR_H
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/ServerRequestInterceptorA.h"
+#include "tao/PI/ORBInitInfo.h"
+
+class ServerInterceptor
+: public PortableInterceptor::ServerRequestInterceptor
+{
+ public:
+ ServerInterceptor (IOP::CodecFactory_var);
+
+ ~ServerInterceptor ();
+
+ virtual char * name ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ private:
+ const char *myname_;
+ IOP::Codec_var codec;
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/SimpleCode.mpc b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/SimpleCode.mpc
new file mode 100644
index 00000000000..051dea85fcd
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/SimpleCode.mpc
@@ -0,0 +1,17 @@
+project(*Server): taoexe, portableserver, pi_server, avoids_minimum_corba {
+ Source_Files {
+ Messenger_i.cpp
+ ServerInitializer.cpp
+ ServerInterceptor.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, pi, avoids_minimum_corba, interceptors {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ ClientInitializer.cpp
+ ClientInterceptor.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/run_test.pl b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/run_test.pl
new file mode 100644
index 00000000000..8804f7ba6d8
--- /dev/null
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/run_test.pl
@@ -0,0 +1,36 @@
+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;
+
+# start MessengerServer
+my($iorfile) = 'Messenger.ior';
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed (
+ $iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill();
+ exit(1);
+}
+
+# start MessengerClient
+select undef, undef, undef, .5;
+$C = new PerlACE::Process("MessengerClient");
+
+if ($C->SpawnWaitKill(15) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/RTCORBA/Messenger.idl b/TAO/DevGuideExamples/RTCORBA/Messenger.idl
new file mode 100644
index 00000000000..0ca944bcc16
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message (in string user_name,
+ in string subject,
+ inout string message);
+};
+
diff --git a/TAO/DevGuideExamples/RTCORBA/MessengerClient.cpp b/TAO/DevGuideExamples/RTCORBA/MessengerClient.cpp
new file mode 100644
index 00000000000..b8273500174
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/MessengerClient.cpp
@@ -0,0 +1,87 @@
+#include "MessengerC.h"
+#include "common.h"
+#include <iostream>
+#include <tao/RTCORBA/RTCORBA.h>
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Get the RTORB
+ CORBA::Object_var obj = orb->resolve_initial_references("RTORB");
+ RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (obj.in());
+
+ // PolicyCurrent.
+ obj = orb->resolve_initial_references("PolicyCurrent");
+ CORBA::PolicyCurrent_var policy_current =
+ CORBA::PolicyCurrent::_narrow(obj.in());
+ if (CORBA::is_nil(policy_current.in())) {
+ std::cerr << "Unable to narrow the PolicyCurrent" << std::endl;
+ return 1;
+ }
+
+ // Destringify ior
+ obj = orb->string_to_object( "file://Messenger.ior" );
+ if( CORBA::is_nil( obj.in() ) ) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if( CORBA::is_nil( messenger.in() ) ) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Set the Private Connection Policy
+ CORBA::PolicyList policy_list(1);
+ policy_list.length (1);
+ policy_list[0] = rt_orb->create_private_connection_policy();
+ policy_current->set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE);
+
+ // Get the RTCurrent.
+ obj = orb->resolve_initial_references ("RTCurrent");
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow(obj.in ());
+
+ // Change to a priority that matches the server
+ current->the_priority(0);
+
+ // Explicitly bind a connection to the server
+ CORBA::PolicyList_var inconsistent_policies;
+ CORBA::Boolean status =
+ messenger->_validate_connection(inconsistent_policies.out());
+ if (!status) {
+ std::cerr << "Unable to explicitly bind to the server" << std::endl;
+ return 1;
+ }
+
+ static const CORBA::Short increment = get_increment();
+ for(CORBA::ULong i = 0; i < get_total_lanes(); i++) {
+
+ // Set the priority to one that matches one of the lanes
+ CORBA::Short priority = i * increment;
+ current->the_priority(priority);
+
+ // Send the message
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+ messenger->send_message( "TAO User", "TAO Test", message.inout() );
+ }
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "MessengerClient caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+ catch(...) {
+ std::cerr << "MessengerClient exception" << std::endl;
+ return 1;
+ }
+
+ std::cout << "messages were sent" << std::endl;
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/RTCORBA/MessengerServer.cpp b/TAO/DevGuideExamples/RTCORBA/MessengerServer.cpp
new file mode 100644
index 00000000000..dd33b8da371
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/MessengerServer.cpp
@@ -0,0 +1,96 @@
+#include "Messenger_i.h"
+#include "common.h"
+#include <iostream>
+#include <fstream>
+#include <fstream>
+#include <tao/RTCORBA/RTCORBA.h>
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Get the RTORB.
+ CORBA::Object_var obj = orb->resolve_initial_references("RTORB");
+ RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow(obj.in());
+
+ // PolicyCurrent.
+ obj = orb->resolve_initial_references("PolicyCurrent");
+ CORBA::PolicyCurrent_var policy_current =
+ CORBA::PolicyCurrent::_narrow(obj.in());
+ if (CORBA::is_nil(policy_current.in())) {
+ std::cerr << "Unable to narrow the PolicyCurrent" << std::endl;
+ return 1;
+ }
+
+ //Get reference to Root POA
+ 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();
+
+ // Create the thread-pool
+ const CORBA::Short increment = get_increment();
+ RTCORBA::ThreadpoolLanes lanes(get_total_lanes());
+ lanes.length(get_total_lanes());
+ std::cout << "Creating " << get_total_lanes() << " lane"
+ << (get_total_lanes() == 1 ? "" : "s") << std::endl;
+ for(CORBA::ULong i = 0; i < get_total_lanes(); i++) {
+ lanes[i].static_threads = 1;
+ lanes[i].dynamic_threads = 0;
+
+ lanes[i].lane_priority = i * increment;
+ std::cout << " Priority: " << lanes[i].lane_priority << std::endl;
+ }
+
+ RTCORBA::ThreadpoolId threadpool_id =
+ rt_orb->create_threadpool_with_lanes (0, // Stack Size
+ lanes,
+ 0, // Allow borrowing
+ 0, // Allow request buffering
+ 0, // Max buffered requests
+ 0); // Max request buffer size
+
+ CORBA::PolicyList poa_policy_list(2);
+ poa_policy_list.length (2);
+
+ poa_policy_list[0] =
+ rt_orb->create_priority_model_policy(RTCORBA::CLIENT_PROPAGATED, 0);
+ poa_policy_list[1] =
+ rt_orb->create_threadpool_policy(threadpool_id);
+
+ PortableServer::POA_var client_propagated_poa =
+ poa->create_POA ("client_propagated_poa",
+ mgr.in (),
+ poa_policy_list);
+
+ // Create an object
+ Messenger_i messenger_servant(orb.in());
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ client_propagated_poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj =
+ client_propagated_poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/RTCORBA/Messenger_i.cpp b/TAO/DevGuideExamples/RTCORBA/Messenger_i.cpp
new file mode 100644
index 00000000000..f39a72e1d26
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/Messenger_i.cpp
@@ -0,0 +1,37 @@
+#include "Messenger_i.h"
+#include <ace/Thread.h>
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i(CORBA::ORB_ptr orb)
+{
+ CORBA::Object_var obj = orb->resolve_initial_references("RTCurrent");
+ rt_current_ = RTCORBA::Current::_narrow(obj.in());
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i()
+{
+}
+
+CORBA::Boolean
+Messenger_i::send_message (const char* user_name,
+ const char* subject,
+ char*& message)
+{
+ CORBA::Short priority = rt_current_->the_priority();
+
+ ACE_hthread_t current;
+ ACE_Thread::self (current);
+ int native_priority;
+
+ std::cout << "Message from: " << user_name << std::endl
+ << "Subject: " << subject << std::endl
+ << "CORBA Priority: " << priority << std::endl;
+ if (ACE_Thread::getprio (current, native_priority) != -1) {
+ std::cout << "Native Priority: " << native_priority << std::endl;
+ }
+ std::cout << "Message: " << message << std::endl << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/RTCORBA/Messenger_i.h b/TAO/DevGuideExamples/RTCORBA/Messenger_i.h
new file mode 100644
index 00000000000..3f494bb1d5f
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/Messenger_i.h
@@ -0,0 +1,40 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <tao/RTCORBA/RTCORBA.h>
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i(CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~Messenger_i();
+
+ virtual CORBA::Boolean send_message(const char* user_name,
+ const char* subject,
+ char*& message);
+
+private:
+ RTCORBA::Current_var rt_current_;
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/RTCORBA/README b/TAO/DevGuideExamples/RTCORBA/README
new file mode 100644
index 00000000000..8f0708c500b
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/README
@@ -0,0 +1,18 @@
+
+DevGuideExamples/RTCORBA/README
+
+This directory contains an RTCORBA example illustrating a simple client and
+a server with a Interface Messenger. The Messenger Interface has
+an operation for sending a message (send_message).
+
+How to Run
+----------
+
+To start the server:
+------------------
+./MessengerServer
+
+
+To start the client:
+------------------
+./MessengerClient
diff --git a/TAO/DevGuideExamples/RTCORBA/RTCORBA.mpc b/TAO/DevGuideExamples/RTCORBA/RTCORBA.mpc
new file mode 100644
index 00000000000..1b4250330e3
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/RTCORBA.mpc
@@ -0,0 +1,17 @@
+project(*Server): rt_server {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ common.cpp
+ }
+}
+
+
+project(*Client): rt_client {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ common.cpp
+ }
+}
+
diff --git a/TAO/DevGuideExamples/RTCORBA/common.cpp b/TAO/DevGuideExamples/RTCORBA/common.cpp
new file mode 100644
index 00000000000..4f5a17ce962
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/common.cpp
@@ -0,0 +1,20 @@
+#include "common.h"
+
+CORBA::ULong
+get_total_lanes()
+{
+#if defined (linux)
+ return 1;
+#elif defined (ACE_CONFIG_WIN32_H)
+ return 3;
+#else
+ return 5;
+#endif
+}
+
+CORBA::Short
+get_increment()
+{
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/RTCORBA/common.h b/TAO/DevGuideExamples/RTCORBA/common.h
new file mode 100644
index 00000000000..5cb01bd5ba8
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/common.h
@@ -0,0 +1,9 @@
+#ifndef MESSENGER_COMMON_H
+#define MESSENGER_COMMON_H
+
+#include <tao/corba.h>
+
+CORBA::ULong get_total_lanes();
+CORBA::Short get_increment();
+
+#endif /* MESSENGER_COMMON_H */
diff --git a/TAO/DevGuideExamples/RTCORBA/run_test.pl b/TAO/DevGuideExamples/RTCORBA/run_test.pl
new file mode 100644
index 00000000000..e672f005f3e
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/run_test.pl
@@ -0,0 +1,37 @@
+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;
+
+$ior="Messenger.ior";
+unlink $ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $ior\n";
+ $S->Kill();
+ exit 1;
+}
+
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient");
+
+if ($C->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+unlink $ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/RTCORBA/svc.conf b/TAO/DevGuideExamples/RTCORBA/svc.conf
new file mode 100644
index 00000000000..511f7c4974e
--- /dev/null
+++ b/TAO/DevGuideExamples/RTCORBA/svc.conf
@@ -0,0 +1,3 @@
+# This is more portable across multiple systems
+
+static RT_ORB_Loader "-ORBPriorityMapping continuous"
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger.idl b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger.idl
new file mode 100644
index 00000000000..8f8adf454b2
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger.idl
@@ -0,0 +1,13 @@
+/* -*- C++ -*- $Id$ */
+
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+
+ void shutdown ( in string user_name );
+ };
+
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerClient.cpp b/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerClient.cpp
new file mode 100644
index 00000000000..7e6551a08a8
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerClient.cpp
@@ -0,0 +1,115 @@
+/* -*- C++ -*- $Id$ */
+
+#include "orbsvcs/SecurityC.h"
+#include "MessengerC.h"
+
+#if 0
+The servers service configuration file
+for this example is:
+---------------------------------------
+# server.conf
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLNoProtection \
+ -SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+---------------------------------------
+
+The clients service configuration file
+for this example is:
+---------------------------------------
+# client.conf
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLNoProtection \
+ -SSLAuthenticate SERVER \
+ -SSLPrivateKey PEM:clientkey.pem \
+ -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+---------------------------------------
+#endif
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init( argc, argv );
+
+ CORBA::Object_var obj =
+ orb->string_to_object( "file://Messenger.ior" );
+
+ Messenger_var messenger =
+ Messenger::_narrow( obj.in() );
+
+ CORBA::String_var message =
+ CORBA::string_dup( "Terminating messenger service!" );
+
+ messenger->send_message( "Chief of Security",
+ "New Directive",
+ message.inout() );
+
+ messenger->shutdown("Chief of Security");
+
+ Security::QOP qop =
+ Security::SecQOPIntegrityAndConfidentiality;
+
+ CORBA::Any want_protection;
+ want_protection <<= qop;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (Security::SecQOPPolicy,
+ want_protection);
+
+ Security::EstablishTrust establish_trust;
+ establish_trust.trust_in_client = 0;
+ establish_trust.trust_in_target = 1;
+
+ CORBA::Any want_trust;
+ want_trust <<= establish_trust;
+
+ CORBA::Policy_var policy2 =
+ orb->create_policy (Security::SecEstablishTrustPolicy,
+ want_trust);
+
+
+ CORBA::PolicyList policy_list (2);
+ policy_list.length (1);
+ policy_list[0] =
+ CORBA::Policy::_duplicate (policy.in ());
+ policy_list.length (2);
+ policy_list[1] =
+ CORBA::Policy::_duplicate (policy2.in ());
+
+
+ CORBA::Object_var object =
+ obj->_set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE);
+
+ Messenger_var messenger2 =
+ Messenger::_narrow( object.in() );
+
+ message =
+ CORBA::string_dup( "Terminating messenger service!" );
+
+ messenger2->send_message( "Chief of Security",
+ "New Directive",
+ message.inout() );
+
+ messenger2->shutdown("Chief of Security");
+
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception("Client: main block");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerServer.cpp b/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerServer.cpp
new file mode 100644
index 00000000000..5f4b7573a9e
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/MessengerServer.cpp
@@ -0,0 +1,64 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+
+ CORBA::Object_var obj =
+ orb->resolve_initial_references( "RootPOA" );
+
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow( obj.in() );
+
+ PortableServer::POAManager_var mgr =
+ poa->the_POAManager();
+ mgr->activate();
+
+ obj =
+ orb->resolve_initial_references ("SSLIOPCurrent");
+
+ SSLIOP::Current_var ssliop_current =
+ SSLIOP::Current::_narrow (obj.in ());
+
+ Messenger_i messenger_servant(orb.in(),
+ ssliop_current.in()
+ );
+
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+
+ std::ofstream iorFile( "Messenger.ior" );
+
+ iorFile << str.in() << std::endl;
+
+ iorFile.close();
+
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ orb->run();
+ poa->destroy (1, 1);
+ orb->destroy ();
+
+ std::cout << "Messenger Server is shut down!"
+ << std::endl;
+ std::cout << std::endl;
+
+ }
+ catch(const CORBA::Exception& ex) {
+ ex._tao_print_exception("Server Error: main block");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.cpp b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.cpp
new file mode 100644
index 00000000000..ca0a314fa0e
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.cpp
@@ -0,0 +1,156 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Messenger_i.h"
+#include <ace/OS_NS_string.h>
+#include <iostream>
+
+Messenger_i::Messenger_i (
+ CORBA::ORB_ptr orb,
+ SSLIOP::Current_ptr ssliop_current
+)
+: orb_(CORBA::ORB::_duplicate(orb)),
+ ssliop_current_(SSLIOP::Current::_duplicate(ssliop_current))
+ {
+ }
+
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+ {
+ if (ssliop_current_->no_context())
+ std::cout << "Message from: " << user_name << std::endl;
+ else
+ std::cout << "SECURE message from: " << user_name << std::endl;
+
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ std::cout << std::endl;
+ return 1;
+ }
+
+
+void Messenger_i::shutdown (
+ const char * user_name
+ )
+ throw(CORBA::SystemException)
+{
+ if ( ! (ssliop_current_->no_context()) )
+ {
+ // requestor is authentic, go ahead and
+ // shut the server down. Report access
+ // ID of requestor prior to shutdown.
+
+ std::cout << "Shutdown command from: " << user_name << std::endl;
+ std::cout << "Status: User authenticated." << std::endl;
+ std::cout << "Action: Sever shutdown in progress..." << std::endl;
+ std::cout << std::endl;
+
+#if 0
+ char name_buf[BUFSIZ];
+
+ //
+ // Populate an attribute type list
+ // to request the initiating principal's
+ // AccessId.
+ //
+ Security::AttributeTypeList requested_attributes;
+ requested_attributes.length(0);
+ Security::AttributeType desired_attribute;
+ desired_attribute.attribute_family.family_definer = 0; // OMG
+ desired_attribute.attribute_family.family = 1; // Privilege
+ // Attributes
+ desired_attribute.attribute_type = Security::AccessId;
+ requested_attributes.length(1);
+ requested_attributes[0] = desired_attribute;
+ //
+ // Request the attribtue
+ //
+ Security::AttributeList_var attrib_list =
+ this->current_->get_attributes(requested_attributes);
+
+ if(attrib_list->length() > 0)
+ {
+ //
+ // Copy the values out
+ //
+ Security::SecAttribute attribute_returned;
+
+ attribute_returned.defining_authority =
+ (attrib_list.in())[0].defining_authority ;
+ attribute_returned.value =
+ (attrib_list.in())[0].value;
+
+ // Certificates are returned in
+ // X.509 format
+ //
+ const char x509[] = "x509";
+ //
+ // Setup a Security::OID (sequence<octet>)
+ // to hold the attribute's defining authority.
+ //
+ Security::OID x509_defining_authority;
+ x509_defining_authority.length(sizeof (x509));
+ //
+ // Populate the defining authority value.
+ //
+ CORBA::Octet *buf =
+ x509_defining_authority.get_buffer();
+ ACE_OS_String::memcpy( buf, x509, sizeof(x509));
+ //
+ // Confirm the defining authority is "x509".
+ //
+ if(attribute_returned.defining_authority ==
+ x509_defining_authority)
+ {
+ //
+ // Get the buffer holding the certificate
+ //
+ CORBA::Octet *der_cert =
+ attribute_returned.value.get_buffer();
+ //
+ // Convert the DER encoded certificate into
+ // OpenSSL's internal format.
+ //
+ X509 *peer = ::d2i_X509 (0,
+ &der_cert,
+ attribute_returned.value.length());
+
+ ::X509_NAME_oneline(::X509_get_subject_name (peer),
+ name_buf,
+ BUFSIZ);
+
+ ::X509_free(peer);
+ }
+ }
+ //
+ // Report the certificate's subject name
+ // and terminate the server
+ //
+ std::cout << "Shutdown commanded by: "
+ << name_buf
+ << std::endl;
+ std::cout << std::endl;
+#endif
+
+ orb_->shutdown (0);
+ }
+ else
+ {
+ // requestor is not secure,
+ // ignore shutdown command
+ std::cout << "Shutdown command from: " << user_name << std::endl;
+ std::cout << "Status: User *NOT* authenticated." << std::endl;
+ std::cout << "Action: Ignored." << std::endl;
+ std::cout << std::endl;
+ }
+}
+
+
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.h b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.h
new file mode 100644
index 00000000000..389eb156981
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/Messenger_i.h
@@ -0,0 +1,40 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include <openssl/ssl.h>
+#include <openssl/x509.h>
+#include <orbsvcs/SecurityC.h>
+#include <orbsvcs/SSLIOPC.h>
+
+#include "MessengerS.h"
+
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ Messenger_i (
+ CORBA::ORB_ptr orb,
+ SSLIOP::Current_ptr ssliop_current
+ );
+
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+ virtual void shutdown (
+ const char * user_name
+ )
+ throw(CORBA::SystemException);
+
+protected:
+ CORBA::ORB_var orb_;
+ SSLIOP::Current_var ssliop_current_;
+};
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/ParticipatingApp.mpc b/TAO/DevGuideExamples/Security/ParticipatingApp/ParticipatingApp.mpc
new file mode 100644
index 00000000000..a2409f8b42b
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/ParticipatingApp.mpc
@@ -0,0 +1,15 @@
+project(*Server): portableserver, orbsvcsexe, security, ssliop {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(ParticipatingApp_Client): orbsvcsexe, security, ssliop {
+ exename = MessengerClient
+
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/README b/TAO/DevGuideExamples/Security/ParticipatingApp/README
new file mode 100644
index 00000000000..5d001721f0b
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/README
@@ -0,0 +1,47 @@
+TAO Security
+
+DevGuideExamples/Security/ParticipatingApp/README
+
+This directory contains an illustration of a security
+aware application that accepts secured and unsecured
+requests and provides access to certain operations
+only for secured requests.
+
+This example uses a single set of service configuration
+files and takes a single path through the application
+code.
+
+For simplicity, the pass phrases have been stripped from the
+private keys included with these examples in the 1.2a release.
+This *should not* be construed as a recommended practice. Instead,
+OCI strongly recommends that the security requirements of each
+real-world application be evaluated carefully and that appropriate
+procedures and practice be established accordingly. Private keys
+without pass phrase protection are easily compromised and may
+allow an unauthorized party to masquerade as an authorized system
+user.
+
+Prior to running the server in these examples, the SSL_CERT_FILE
+environment variable must be set, e.g.,
+ # /bin/bash
+ export SSL_CERT_FILE=cacert.pem
+or
+ rem Windows
+ set SSL_CERT_FILE=cacert.pem
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server.conf
+
+To run the client:
+ ./MessengerClient -ORBSvcConf client.conf
+
+
+-----------------------------------------
+Files: DevGuideExamples/Security/ParticipatingApp
+
+Messenger.idl - Messenger interface definition.
+Messenger_i.h - Messenger servant class definition.
+Messenger_i.cpp - Messenger servant implementation.
+MessengerServer.cpp - MessengerServer process main.
+MessengerClient.cpp - MessengerClient process main.
+
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/cacert.pem b/TAO/DevGuideExamples/Security/ParticipatingApp/cacert.pem
new file mode 100644
index 00000000000..c493d28a523
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/cacert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDujCCAyOgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBoDELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNVBAoT
+Fk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMU
+Q2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5j
+b20wHhcNMDMwNzIzMjAyNDIwWhcNMTMwNzIwMjAyNDIwWjCBoDELMAkGA1UEBhMC
+VVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNV
+BAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UE
+AxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdl
+Yi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO4QS4bqrXVuBnHsOg1/
+gijXjiWhFTngG/sDLWAA52fHIobyFo5//7UaLedke0fkwqsmky8hjzSbXGJsGI5g
+Yjp2Va7WeJhRQNr8VYWobCq00f//drHN2NF5M23Cx0JF9WfyfWpqq5TQRGtVZ+We
++q4S6wH1exZrVGHfkp5Xq5FvAgMBAAGjggEAMIH9MB0GA1UdDgQWBBQvTY0YWmHq
+o2TMOKba/ECH9ayXZzCBzQYDVR0jBIHFMIHCgBQvTY0YWmHqo2TMOKba/ECH9ayX
+Z6GBpqSBozCBoDELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYD
+VQQHEwlTdC4gTG91aXMxHzAdBgNVBAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4x
+DDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAa
+BgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkq
+hkiG9w0BAQQFAAOBgQBgjn97nbyyjFxyHC8vheAiDCQRblI4lZbZC6vSmxxqEGze
+eAMiTYL2iK3vj2Ot3V2/o5VdLyEYV4RBP2iq1XuMYXjmL2ni+NVgepyXceynH8/b
+72yciZZcDE5FVUaMUHAgZUpxsGSDyD70LnOFwBxuvxtlMtG5vXYNvwF/FJPs1g==
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/client.conf b/TAO/DevGuideExamples/Security/ParticipatingApp/client.conf
new file mode 100644
index 00000000000..cffba696b54
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/client.conf
@@ -0,0 +1,6 @@
+# $Id$
+
+# client.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLNoProtection -SSLAuthenticate SERVER -SSLPrivateKey PEM:clientkey.pem -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/clientcert.pem b/TAO/DevGuideExamples/Security/ParticipatingApp/clientcert.pem
new file mode 100644
index 00000000000..56616fcd469
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/clientcert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQQwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjIwN1oXDTEzMDgwNTAwMjIwN1owgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBmNs
+aWVudDEgMB4GCSqGSIb3DQEJARYRY2xpZW50QG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAMYaaQgEmp2zv0t+MAEGf5GIsKSIB1YFrkkVR6Qv
+LP0t9FHDPGFawh/aK3Yq+l7RiNpK1H5SSOaIavm4xV/3tpHxzuRjd0H3fdhaoAgD
+xvcYZ75l662PEa25MCJsp40tACO0hGNOQCJ8kWVmT4xEhKcFl3xm+1OvNbwDM/pA
+t4WpAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEArs6S6qud6D9t6AcGJS91XWqbBY1G
+rSgmv9yFbvUyrGAQuMpyNuYTGlZA+Nd3EAjYlwP4fWbzUMM0MEtd3Xl0Aep0O39W
+Cgp9HxDaJi3b4h63cd/B0su+2CNd4P6+NOX+IxgrrioCgKSnu6Nxy14fb03RQhjl
+a3vOY5Juf8ySB/M=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/clientkey.pem b/TAO/DevGuideExamples/Security/ParticipatingApp/clientkey.pem
new file mode 100644
index 00000000000..2b4af2322ad
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/clientkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDGGmkIBJqds79LfjABBn+RiLCkiAdWBa5JFUekLyz9LfRRwzxh
+WsIf2it2Kvpe0YjaStR+UkjmiGr5uMVf97aR8c7kY3dB933YWqAIA8b3GGe+Zeut
+jxGtuTAibKeNLQAjtIRjTkAifJFlZk+MRISnBZd8ZvtTrzW8AzP6QLeFqQIDAQAB
+AoGAJx1X16lxDepLvxAvUkSCM64Vkqb5K9b7TprRBm36KBNGxk4SQfa1laxyIGbk
+AIzGxLM5uadtlXciCCSfdA9pEJbjtxSRJt2RbOWioT3sfIzXO7SCMHuuRjnPK3P8
+rgFmOOpo/ldVZ3mBJajxzWTEFXMUTAC4tB2j2B6of7MG5fECQQDu+uKzI2QjiTpW
+5WFd/vzpS2SpDHks4sEu0F6zk1Zhbsc3KoJd3xxSLhKFLLoRDVZsDKE3opr7WRNT
++sjoGRY3AkEA1DZArJqLeWuB8L8GjC/AtMXsxlSe3Iy9X+4uffZ/y5A1JbYidLJl
+3FlejMoQqp0EpbHO+mRCMSHyJqAFW1ZTHwJBANjv3oMHiYvIsrDXIQAWzLdqvUHI
+FOfuH7fDZ3RUN4HS8fzeFeHo+uiO8jj6VR3NoboL7P14GoA4aBc//MjUnRkCQQCH
+KZ770NtxFKaIvkLfWzL0cPQkRpWAiCu+RChclnpDH7CaOm2rwkzakhmEttbytFvX
+ZW8dUGpQfPyM2XNP/6WlAkEAoOQ5UI1WREbjoJs5mTwTG1gTrQjShQwjC0dqt66s
+bOS5os5EePGdctm//Xq7uR4/6hB6T7npPYqiyfWix1SINQ==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/run_test.pl b/TAO/DevGuideExamples/Security/ParticipatingApp/run_test.pl
new file mode 100644
index 00000000000..2d9f698a132
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/run_test.pl
@@ -0,0 +1,38 @@
+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;
+
+$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$file = PerlACE::LocalFile("Messenger.ior");
+
+unlink $file;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer",
+ "-ORBSvcConf server.conf");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $S->Kill ();
+ exit 1;
+}
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient",
+ "-ORBSvcConf client.conf");
+
+if ($C->SpawnWaitKill(10) != 0) {
+ exit (1);
+}
+
+if ($S->WaitKill(10) == -1) {
+ $S->Kill();
+}
+
+exit 0;
+
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/server.conf b/TAO/DevGuideExamples/Security/ParticipatingApp/server.conf
new file mode 100644
index 00000000000..380312b03fc
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/server.conf
@@ -0,0 +1,5 @@
+# $Id$
+
+# server.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLNoProtection -SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:serverkey.pem -SSLCertificate PEM:servercert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/servercert.pem b/TAO/DevGuideExamples/Security/ParticipatingApp/servercert.pem
new file mode 100644
index 00000000000..9659fb07334
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/servercert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQMwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjAyOVoXDTEzMDgwNTAwMjAyOVowgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBlNl
+cnZlcjEgMB4GCSqGSIb3DQEJARYRc2VydmVyQG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAKw+tjwQz/stcesfm6WvnB6D/FTYu79tHzGUDlSV
+N+kycFYcZfsRmIEo5afG+epOwlp1f9Wpij23AMY4BcdcSP9R4yhH46uMFThQhkn9
+fraZ8slcgVog5G6MwXmsWb5gThjgiT0KPSQHkEU0bryw+CiM4oV+9dSaFBLa3Uqc
+iQZdAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAur+t7sIqGjqAPgFtFcgByAJTvNYb
+UDZ43AGd22tCtT/usoy/x9qsQv8jwd8kA8yUNQUmjRxR4vEkZ06L6HF8Ii1QmU/E
+fZ7YcjXjWxgnCEQGSXuHLhmlIMAlXNvX1XzNddu/NuRbSP3lYS/j32W8gTb6MdyL
+8bOkIqRpVY0ek80=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/ParticipatingApp/serverkey.pem b/TAO/DevGuideExamples/Security/ParticipatingApp/serverkey.pem
new file mode 100644
index 00000000000..c61b8152649
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/ParticipatingApp/serverkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCsPrY8EM/7LXHrH5ulr5weg/xU2Lu/bR8xlA5UlTfpMnBWHGX7
+EZiBKOWnxvnqTsJadX/VqYo9twDGOAXHXEj/UeMoR+OrjBU4UIZJ/X62mfLJXIFa
+IORujMF5rFm+YE4Y4Ik9Cj0kB5BFNG68sPgojOKFfvXUmhQS2t1KnIkGXQIDAQAB
+AoGBAKjg08wQr9qVtBvT4ceRZoCE5+JIncwSMYNqpqJHq4n46iuDrHl9xwjcEE9v
+x5jzn5sRmUTj9aaMxzWRuBi/YtFVmgsl8lNiBOniIkFYqIyXfzNgX+2qyRzgOtAo
+0ByWFsqkLmW9cUXWaICkM49b9Jz7SnmPs+9VWGiNrjgJSiABAkEA4eFIc82mP2KJ
+wap8LJV7GLBA3iiVRmOgVb0TvRMitFWPGdGKFcsAVVkogQ/zIixKeZKc5enMhAI9
+i3Q2tmolZQJBAMM2hlSbJZncMjooKBlp2VZgUpEjbBPpD9XGgA5BO2RfKi3B29T9
+2v8I3m9WbCxbtFKlHcjNT3GToGCoi4S1qZkCQDcn7qwwZE8H/cFnoui0G5ncuApH
+eKP2gdlN0TsTKB9G4SmZzBEkP9GXcteJEIKgtBLZpSxTGdiGP4cE+rMyWi0CQDam
+TgbjhCxFq74CPe+XZWO8BYFiREByr58uOe1Dr8fSqHE040EGbEeXiQXsUM4+QgYc
++XCcoY/vPyewJ5bYcIkCQERqwlO9/JUiX2w01l82tMxVK8DmN3QwHWJxNexD5Ewf
+QFG6FYFPNHCR2f+MUSMFp1djUSVpCrWbppmlr96uZ48=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger.idl b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger.idl
new file mode 100644
index 00000000000..05cf30bf5f9
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger.idl
@@ -0,0 +1,11 @@
+/* -*- C++ -*- $Id$ */
+
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerClient.cpp b/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerClient.cpp
new file mode 100644
index 00000000000..68fd1fec4db
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerClient.cpp
@@ -0,0 +1,187 @@
+/* -*- C++ -*- $Id$ */
+
+#include <ace/OS.h>
+#include <ace/Get_Opt.h>
+
+#include "MessengerC.h"
+#include "orbsvcs/SecurityC.h"
+
+// Policy Example 1
+// ================
+//
+// Example of a client that downgrades
+// from message protection to no message
+// protection and upgrades from no
+// peer authentication to authentication
+// of targets, i.e., authentication of
+// servers.
+//
+// The server's service configuration file
+// for this example is
+//
+// # server.conf
+// dynamic SSLIOP_Factory Service_Object *
+// TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+// "-SSLNoProtection
+// -SSLAuthenticate SERVER_AND_CLIENT
+// -SSLPrivateKey PEM:serverkey.pem
+// -SSLCertificate PEM:servercert.pem"
+//
+// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+//
+// The clients service configuration file
+// for this example is:
+//
+// # client.conf
+// dynamic SSLIOP_Factory Service_Object *
+// TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+// "-SSLAuthenticate NONE
+// -SSLPrivateKey PEM:clientkey.pem
+// -SSLCertificate PEM:clientcert.pem"
+//
+// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+//
+// Policy Example 2
+// ================
+//
+// Example of client upgrading from
+// no message protection and no
+// no authentication to message
+// protection and authentication
+// of targets, i.e., authentication
+// of servers.
+//
+// The server's service configuration file for this example is
+//
+// # server.conf
+// dynamic SSLIOP_Factory Service_Object *
+// TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+// "-SSLAuthenticate SERVER_AND_CLIENT
+// -SSLPrivateKey PEM:serverkey.pem
+// -SSLCertificate PEM:servercert.pem"
+//
+// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+//
+// The client's service configuration file
+// for this example is:
+//
+// # client.conf
+// dynamic SSLIOP_Factory Service_Object *
+// TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+// "-SSLNoProtection
+// -SSLAuthenticate NONE
+// -SSLPrivateKey PEM:clientkey.pem
+// -SSLCertificate PEM:clientcert.pem"
+//
+// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+//
+
+
+int which = 0;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "e:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ which = ACE_OS::atoi(get_opts.optarg);
+ if(which < 1 || 2 < which)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-e [12]"
+ "\n",
+ argv [0]),
+ -1);
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-e [12]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init( argc, argv );
+
+ CORBA::Object_var obj =
+ orb->string_to_object( "file://Messenger.ior" );
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+ else if(which < 1 || 2 < which)
+ return 1;
+
+ Security::QOP qop;
+ CORBA::Any protection;
+ Security::EstablishTrust establish_trust;
+ CORBA::Any trust;
+ CORBA::PolicyList policy_list (2);
+
+ if (which == 1)
+ {
+ qop = Security::SecQOPNoProtection;
+ //qop = Security::SecQOPIntegrity;
+
+ establish_trust.trust_in_client = 0;
+ establish_trust.trust_in_target = 1;
+ }
+ else
+ {
+ qop = Security::SecQOPIntegrityAndConfidentiality;
+
+ establish_trust.trust_in_client = 0;
+ establish_trust.trust_in_target = 1;
+ }
+
+ protection <<= qop;
+ trust <<= establish_trust;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (Security::SecQOPPolicy, protection);
+
+ CORBA::Policy_var policy2 =
+ orb->create_policy (Security::SecEstablishTrustPolicy, trust);
+
+ policy_list.length (1);
+ policy_list[0] = CORBA::Policy::_duplicate (policy.in ());
+ policy_list.length (2);
+ policy_list[1] = CORBA::Policy::_duplicate (policy2.in ());
+
+ CORBA::Object_var object =
+ obj->_set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE);
+
+ Messenger_var messenger =
+ Messenger::_narrow( object.in() );
+
+ CORBA::String_var message =
+ CORBA::string_dup( "Implementing security policy now!" );
+
+ messenger->send_message( "Chief of Security",
+ "New Directive",
+ message.inout() );
+ }
+ catch(const CORBA::Exception& ex) {
+ ex._tao_print_exception("Client: main block");
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerServer.cpp b/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerServer.cpp
new file mode 100644
index 00000000000..c6fdabeeb1e
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/MessengerServer.cpp
@@ -0,0 +1,46 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex) {
+ ex._tao_print_exception("Server Error: main block");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.cpp b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.cpp
new file mode 100644
index 00000000000..a7164df866b
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.cpp
@@ -0,0 +1,28 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+ {
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.h b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.h
new file mode 100644
index 00000000000..7fdf50bdb45
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/Messenger_i.h
@@ -0,0 +1,32 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw (CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/PolicyControllingApp.mpc b/TAO/DevGuideExamples/Security/PolicyControllingApp/PolicyControllingApp.mpc
new file mode 100644
index 00000000000..2a2b7c7c4a2
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/PolicyControllingApp.mpc
@@ -0,0 +1,13 @@
+project(*Server): portableserver, orbsvcsexe, security, ssliop {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): orbsvcsexe, security, ssliop {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/README b/TAO/DevGuideExamples/Security/PolicyControllingApp/README
new file mode 100644
index 00000000000..bf3b57390a4
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/README
@@ -0,0 +1,144 @@
+TAO Security
+
+DevGuideExamples/Security/PolicyControllingApp/README
+
+This directory contains an illustration of a security aware
+application that modifies security service policies. Similar
+to the security unaware application example, these examples
+vary the client and server's configurations. However, there
+are also different paths through the client application that
+demonstrate different policy settings.
+
+For readability, long text lines from the example's service
+configuration files are split into multiple lines. A backslash
+indicates the end of partial line except for the final fragment.
+The backslashes should be removed and the fragments joined for
+use with the example programs.
+
+For simplicity, the pass phrases have been stripped from the
+private keys included with these examples in the 1.2a release.
+This *should not* be construed as a recommended practice. Instead,
+OCI strongly recommends that the security requirements of each
+real-world application be evaluated carefully and that appropriate
+procedures and practice be established accordingly. Private keys
+without pass phrase protection are easily compromised and may
+allow an unauthorized party to masquerade as an authorized system
+user.
+
+Prior to running the server in these examples, the SSL_CERT_FILE
+environment variable must be set, e.g.,
+ # /bin/bash
+ export SSL_CERT_FILE=cacert.pem
+or
+ rem Windows
+ set SSL_CERT_FILE=cacert.pem
+
+Example 1: Client sets Quality of Protection to NoProtection
+------------------------------------------------------------
+The server is configured to accept both secured and unsecured
+invocations (by setting -SSLNoProtection). The client is
+configured to make secured invocations only. The client
+application sets the quality of protection policy to
+no protection to make an unsecured invocation to the server.
+
+The server's configuration is:
+
+#
+# server.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLNoProtection \
+ -SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of server.conf
+#
+
+The client's configuration is:
+
+#
+# client.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate NONE \
+ -SSLPrivateKey PEM:clientkey.pem \
+ -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of client.conf
+#
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server.conf
+
+To run the client:
+ ./MessengerClient -e 1 -ORBSvcConf client.conf
+
+Note: as presented in the 1.2a Developer's Guide, the client code
+for this first example also manipulates the establish trust
+policy. After the text went to print, changes in TAO have required
+a change to this example such that the establish trust policy can't
+be modified as shown in the text without causing an exception. This
+example has been modified accordingly to execute without causing an
+exception.
+
+Example 2: Client sets Quality of Protection to IntegrityAndConfidentiality
+and EstablishTrust to authenticate the server
+---------------------------------------------------------------------------
+The server is configured to accept secured invocations only. The client
+is configured to issue unsecured invocations by default (-SSLNoProtection is
+set). The client sets the quality of protection policy to integrity and
+confidentiality and establish trust policy to authenticate the server. This
+can only be achieved via a secured invocation.
+
+The server's configuration is:
+
+#
+# server1.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of server1.conf
+#
+
+The client's configuration is:
+
+#
+# client1.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLNoProtection \
+ -SSLAuthenticate NONE \
+ -SSLPrivateKey PEM:clientkey.pem \
+ -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of client1.conf
+#
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server1.conf
+
+To run the client:
+ ./MessengerClient -e 2 -ORBSvcConf client1.conf
+
+
+--------------------------------------------------
+Files: DevGuideExamples/Security/PolicyControllingApp
+
+Messenger.idl - Messenger interface definition.
+Messenger_i.h - Messenger servant class definition.
+Messenger_i.cpp - Messenger servant implementation.
+MessengerServer.cpp - MessengerServer process main.
+MessengerClient.cpp - MessengerClient process main.
+
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/cacert.pem b/TAO/DevGuideExamples/Security/PolicyControllingApp/cacert.pem
new file mode 100644
index 00000000000..c493d28a523
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/cacert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDujCCAyOgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBoDELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNVBAoT
+Fk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMU
+Q2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5j
+b20wHhcNMDMwNzIzMjAyNDIwWhcNMTMwNzIwMjAyNDIwWjCBoDELMAkGA1UEBhMC
+VVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNV
+BAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UE
+AxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdl
+Yi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO4QS4bqrXVuBnHsOg1/
+gijXjiWhFTngG/sDLWAA52fHIobyFo5//7UaLedke0fkwqsmky8hjzSbXGJsGI5g
+Yjp2Va7WeJhRQNr8VYWobCq00f//drHN2NF5M23Cx0JF9WfyfWpqq5TQRGtVZ+We
++q4S6wH1exZrVGHfkp5Xq5FvAgMBAAGjggEAMIH9MB0GA1UdDgQWBBQvTY0YWmHq
+o2TMOKba/ECH9ayXZzCBzQYDVR0jBIHFMIHCgBQvTY0YWmHqo2TMOKba/ECH9ayX
+Z6GBpqSBozCBoDELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYD
+VQQHEwlTdC4gTG91aXMxHzAdBgNVBAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4x
+DDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAa
+BgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkq
+hkiG9w0BAQQFAAOBgQBgjn97nbyyjFxyHC8vheAiDCQRblI4lZbZC6vSmxxqEGze
+eAMiTYL2iK3vj2Ot3V2/o5VdLyEYV4RBP2iq1XuMYXjmL2ni+NVgepyXceynH8/b
+72yciZZcDE5FVUaMUHAgZUpxsGSDyD70LnOFwBxuvxtlMtG5vXYNvwF/FJPs1g==
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/client.conf b/TAO/DevGuideExamples/Security/PolicyControllingApp/client.conf
new file mode 100644
index 00000000000..1130e620d7b
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/client.conf
@@ -0,0 +1,6 @@
+# $Id$
+
+# client.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate NONE -SSLPrivateKey PEM:clientkey.pem -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/client1.conf b/TAO/DevGuideExamples/Security/PolicyControllingApp/client1.conf
new file mode 100644
index 00000000000..23f4e0a5859
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/client1.conf
@@ -0,0 +1,6 @@
+# $Id$
+
+# client.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLNoProtection -SSLAuthenticate NONE -SSLPrivateKey PEM:clientkey.pem -SSLCertificate PEM:clientcert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/clientcert.pem b/TAO/DevGuideExamples/Security/PolicyControllingApp/clientcert.pem
new file mode 100644
index 00000000000..56616fcd469
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/clientcert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQQwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjIwN1oXDTEzMDgwNTAwMjIwN1owgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBmNs
+aWVudDEgMB4GCSqGSIb3DQEJARYRY2xpZW50QG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAMYaaQgEmp2zv0t+MAEGf5GIsKSIB1YFrkkVR6Qv
+LP0t9FHDPGFawh/aK3Yq+l7RiNpK1H5SSOaIavm4xV/3tpHxzuRjd0H3fdhaoAgD
+xvcYZ75l662PEa25MCJsp40tACO0hGNOQCJ8kWVmT4xEhKcFl3xm+1OvNbwDM/pA
+t4WpAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEArs6S6qud6D9t6AcGJS91XWqbBY1G
+rSgmv9yFbvUyrGAQuMpyNuYTGlZA+Nd3EAjYlwP4fWbzUMM0MEtd3Xl0Aep0O39W
+Cgp9HxDaJi3b4h63cd/B0su+2CNd4P6+NOX+IxgrrioCgKSnu6Nxy14fb03RQhjl
+a3vOY5Juf8ySB/M=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/clientkey.pem b/TAO/DevGuideExamples/Security/PolicyControllingApp/clientkey.pem
new file mode 100644
index 00000000000..2b4af2322ad
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/clientkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDGGmkIBJqds79LfjABBn+RiLCkiAdWBa5JFUekLyz9LfRRwzxh
+WsIf2it2Kvpe0YjaStR+UkjmiGr5uMVf97aR8c7kY3dB933YWqAIA8b3GGe+Zeut
+jxGtuTAibKeNLQAjtIRjTkAifJFlZk+MRISnBZd8ZvtTrzW8AzP6QLeFqQIDAQAB
+AoGAJx1X16lxDepLvxAvUkSCM64Vkqb5K9b7TprRBm36KBNGxk4SQfa1laxyIGbk
+AIzGxLM5uadtlXciCCSfdA9pEJbjtxSRJt2RbOWioT3sfIzXO7SCMHuuRjnPK3P8
+rgFmOOpo/ldVZ3mBJajxzWTEFXMUTAC4tB2j2B6of7MG5fECQQDu+uKzI2QjiTpW
+5WFd/vzpS2SpDHks4sEu0F6zk1Zhbsc3KoJd3xxSLhKFLLoRDVZsDKE3opr7WRNT
++sjoGRY3AkEA1DZArJqLeWuB8L8GjC/AtMXsxlSe3Iy9X+4uffZ/y5A1JbYidLJl
+3FlejMoQqp0EpbHO+mRCMSHyJqAFW1ZTHwJBANjv3oMHiYvIsrDXIQAWzLdqvUHI
+FOfuH7fDZ3RUN4HS8fzeFeHo+uiO8jj6VR3NoboL7P14GoA4aBc//MjUnRkCQQCH
+KZ770NtxFKaIvkLfWzL0cPQkRpWAiCu+RChclnpDH7CaOm2rwkzakhmEttbytFvX
+ZW8dUGpQfPyM2XNP/6WlAkEAoOQ5UI1WREbjoJs5mTwTG1gTrQjShQwjC0dqt66s
+bOS5os5EePGdctm//Xq7uR4/6hB6T7npPYqiyfWix1SINQ==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/run_test.pl b/TAO/DevGuideExamples/Security/PolicyControllingApp/run_test.pl
new file mode 100644
index 00000000000..16cd049b735
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/run_test.pl
@@ -0,0 +1,67 @@
+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;
+
+$file = PerlACE::LocalFile("Messenger.ior");
+
+unlink $file;
+
+$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer",
+ "-ORBSvcConf server.conf");
+
+$S1 = new PerlACE::Process("MessengerServer",
+ "-ORBSvcConf server1.conf");
+
+$C = new PerlACE::Process("MessengerClient",
+ "-e 1 -ORBSvcConf client.conf");
+
+$C1 = new PerlACE::Process("MessengerClient",
+ "-e 2 -ORBSvcConf client1.conf");
+
+
+print STDERR "\n\nSecurity Policy Controlling Application Examples\n";
+print STDERR "------------------------------------------------\n";
+
+print STDERR "Starting Messenger Server, example 1...\n\n";
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($file, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+print STDERR "\nStarting MessengerClient, example 1...\n\n";
+if ($C->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+unlink $file;
+$S->Kill();
+
+print STDERR "\nStarting Messenger Server, example 2...\n\n";
+$S1->Spawn();
+if (PerlACE::waitforfile_timed ($file, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+print STDERR "\nStarting MessengerClient, example 2...\n\n";
+if ($C1->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S1->Kill();
+
+exit 0;
+
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/server.conf b/TAO/DevGuideExamples/Security/PolicyControllingApp/server.conf
new file mode 100644
index 00000000000..380312b03fc
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/server.conf
@@ -0,0 +1,5 @@
+# $Id$
+
+# server.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLNoProtection -SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:serverkey.pem -SSLCertificate PEM:servercert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/server1.conf b/TAO/DevGuideExamples/Security/PolicyControllingApp/server1.conf
new file mode 100644
index 00000000000..f975ec687f8
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/server1.conf
@@ -0,0 +1,5 @@
+# $Id$
+
+# server.conf
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:serverkey.pem -SSLCertificate PEM:servercert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/servercert.pem b/TAO/DevGuideExamples/Security/PolicyControllingApp/servercert.pem
new file mode 100644
index 00000000000..9659fb07334
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/servercert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQMwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjAyOVoXDTEzMDgwNTAwMjAyOVowgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBlNl
+cnZlcjEgMB4GCSqGSIb3DQEJARYRc2VydmVyQG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAKw+tjwQz/stcesfm6WvnB6D/FTYu79tHzGUDlSV
+N+kycFYcZfsRmIEo5afG+epOwlp1f9Wpij23AMY4BcdcSP9R4yhH46uMFThQhkn9
+fraZ8slcgVog5G6MwXmsWb5gThjgiT0KPSQHkEU0bryw+CiM4oV+9dSaFBLa3Uqc
+iQZdAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAur+t7sIqGjqAPgFtFcgByAJTvNYb
+UDZ43AGd22tCtT/usoy/x9qsQv8jwd8kA8yUNQUmjRxR4vEkZ06L6HF8Ii1QmU/E
+fZ7YcjXjWxgnCEQGSXuHLhmlIMAlXNvX1XzNddu/NuRbSP3lYS/j32W8gTb6MdyL
+8bOkIqRpVY0ek80=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/PolicyControllingApp/serverkey.pem b/TAO/DevGuideExamples/Security/PolicyControllingApp/serverkey.pem
new file mode 100644
index 00000000000..c61b8152649
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/PolicyControllingApp/serverkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCsPrY8EM/7LXHrH5ulr5weg/xU2Lu/bR8xlA5UlTfpMnBWHGX7
+EZiBKOWnxvnqTsJadX/VqYo9twDGOAXHXEj/UeMoR+OrjBU4UIZJ/X62mfLJXIFa
+IORujMF5rFm+YE4Y4Ik9Cj0kB5BFNG68sPgojOKFfvXUmhQS2t1KnIkGXQIDAQAB
+AoGBAKjg08wQr9qVtBvT4ceRZoCE5+JIncwSMYNqpqJHq4n46iuDrHl9xwjcEE9v
+x5jzn5sRmUTj9aaMxzWRuBi/YtFVmgsl8lNiBOniIkFYqIyXfzNgX+2qyRzgOtAo
+0ByWFsqkLmW9cUXWaICkM49b9Jz7SnmPs+9VWGiNrjgJSiABAkEA4eFIc82mP2KJ
+wap8LJV7GLBA3iiVRmOgVb0TvRMitFWPGdGKFcsAVVkogQ/zIixKeZKc5enMhAI9
+i3Q2tmolZQJBAMM2hlSbJZncMjooKBlp2VZgUpEjbBPpD9XGgA5BO2RfKi3B29T9
+2v8I3m9WbCxbtFKlHcjNT3GToGCoi4S1qZkCQDcn7qwwZE8H/cFnoui0G5ncuApH
+eKP2gdlN0TsTKB9G4SmZzBEkP9GXcteJEIKgtBLZpSxTGdiGP4cE+rMyWi0CQDam
+TgbjhCxFq74CPe+XZWO8BYFiREByr58uOe1Dr8fSqHE040EGbEeXiQXsUM4+QgYc
++XCcoY/vPyewJ5bYcIkCQERqwlO9/JUiX2w01l82tMxVK8DmN3QwHWJxNexD5Ewf
+QFG6FYFPNHCR2f+MUSMFp1djUSVpCrWbppmlr96uZ48=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger.idl b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger.idl
new file mode 100644
index 00000000000..05cf30bf5f9
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger.idl
@@ -0,0 +1,11 @@
+/* -*- C++ -*- $Id$ */
+
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp
new file mode 100644
index 00000000000..76f812e7cff
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerClient.cpp
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+#include "MessengerC.h"
+#include <iostream>
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ // Destringify ior
+ CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup(
+ "Implementing security policy now!" );
+ messenger->send_message( "Chief of Security",
+ "New Directive",
+ message.inout() );
+ std::cout << "message was sent" << std::endl;
+ }
+
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught CORBA excepti.o.n: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerI.cpp b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerI.cpp
new file mode 100644
index 00000000000..bcc73c50247
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerI.cpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "MessengerI.h"
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+ {
+ //Add your implementation here
+ }
+
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerServer.cpp b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerServer.cpp
new file mode 100644
index 00000000000..8cdfce1b28e
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/MessengerServer.cpp
@@ -0,0 +1,46 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Register the servant with the RootPOA, obtain its object
+ // reference, stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.cpp b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.cpp
new file mode 100644
index 00000000000..0d8656c4c88
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.cpp
@@ -0,0 +1,35 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException)
+
+ {
+ std::cout << "Message from: " << user_name << std::endl;
+ std::cout << "Subject: " << subject << std::endl;
+ std::cout << "Message: " << message << std::endl;
+ return 1;
+ }
+
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.h b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.h
new file mode 100644
index 00000000000..b7ffc8a2fa5
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/Messenger_i.h
@@ -0,0 +1,32 @@
+/* -*- C++ -*- $Id$ */
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+ throw(CORBA::SystemException);
+
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/README b/TAO/DevGuideExamples/Security/SecurityUnawareApp/README
new file mode 100644
index 00000000000..7eebb03ebfb
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/README
@@ -0,0 +1,172 @@
+TAO Security
+
+DevGuideExamples/Security/SecurityUnawareApp/README
+
+This directory contains an illustration of a security unaware
+application. The examples vary the client's configuration to
+demonstrate different features. For each of these examples,
+however, the client and server process code remains the same.
+
+For readability, long text lines from the example's service
+configuration files are split into multiple lines. A backslash
+indicates the end of partial line except for the final fragment.
+The backslashes should be removed and the fragments joined for
+use with the example programs.
+
+For simplicity, the pass phrases have been stripped from the
+private keys included with these examples in the 1.2a release.
+This *should not* be construed as a recommended practice. Instead,
+OCI strongly recommends that the security requirements of each
+real-world application be evaluated carefully and that appropriate
+procedures and practice be established accordingly. Private keys
+without pass phrase protection are easily compromised and may
+allow an unauthorized party to masquerade as an authorized system
+user.
+
+Prior to running the server in these examples, the SSL_CERT_FILE
+environment variable must be set, e.g.,
+ # /bin/bash
+ export SSL_CERT_FILE=cacert.pem
+or
+ rem Windows
+ set SSL_CERT_FILE=cacert.pem
+
+For examples 1 and 2, the client's environment should also
+define SSL_CERT_FILE appropriately. The final example
+demonstrates how to establish a connection between a client
+and server such that the client does not authenticate the
+server and therefore does not need a value for SSL_CERT_FILE.
+
+
+
+Example 1: Secured server and unsecured client
+----------------------------------------------
+The server is configured to accept requests only via secured
+connections. No specific configurationi is provided for the
+client so it has the default configuration.
+
+The server's configuration is:
+
+#
+# server.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of server.conf
+#
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server.conf
+
+To run the client:
+ ./MessengerClient
+
+
+
+Example 2: Secured server and unsecured client
+----------------------------------------------
+Both server and client are configured to issue and accept
+requests via secured connections.
+
+The server's configuration is:
+
+#
+# server.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of server.conf
+#
+
+The client's configuration is:
+
+#
+# client.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of client.conf
+#
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server.conf
+
+To run the client:
+ ./MessengerClient -ORBSvcConf client.conf
+
+
+
+Example 3: client doesn't authenticate server
+---------------------------------------------
+The client is configured such that it doesn't authenticate
+the server. It still employs an encrypted connection but,
+since it doesn't need a CA certificate, no value for
+SSL_CERT_FILE is required.
+
+The server's configuration is:
+
+#
+# server.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate SERVER_AND_CLIENT \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of server.conf
+#
+
+The client's configuration is:
+
+#
+# client.conf
+#
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() \
+ "-SSLAuthenticate NONE \
+ -SSLPrivateKey PEM:serverkey.pem \
+ -SSLCertificate PEM:servercert.pem"
+
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+#
+# end of client.conf
+#
+
+To run the server:
+ ./MessengerServer -ORBSvcConf server.conf
+
+To run the client:
+ ./MessengerClient -ORBSvcConf client.conf
+
+If a value for SSL_CERT_FILE has already been placed in the
+client's environment, the client may be executed as follows (on
+Unix platforms):
+ SSL_CERT_FILE= ./MessengerClient -ORBSvcConf client.conf
+
+
+
+--------------------------------------------------
+Files: DevGuideExamples/Security/SecurityUnawareApp/
+
+Messenger.idl - Messenger interface definition.
+Messenger_i.h - Messenger servant class definition.
+Messenger_i.cpp - Messenger servant implementation.
+MessengerServer.cpp - MessengerServer process main.
+MessengerClient.cpp - MessengerClient process main.
+
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/SecurityUnawareApp.mpc b/TAO/DevGuideExamples/Security/SecurityUnawareApp/SecurityUnawareApp.mpc
new file mode 100644
index 00000000000..7c31be7f066
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/SecurityUnawareApp.mpc
@@ -0,0 +1,13 @@
+project(*Server): taoexe, portableserver, security, ssl {
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, security, ssl {
+ Source_Files {
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/cacert.pem b/TAO/DevGuideExamples/Security/SecurityUnawareApp/cacert.pem
new file mode 100644
index 00000000000..c493d28a523
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/cacert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDujCCAyOgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBoDELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNVBAoT
+Fk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMU
+Q2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5j
+b20wHhcNMDMwNzIzMjAyNDIwWhcNMTMwNzIwMjAyNDIwWjCBoDELMAkGA1UEBhMC
+VVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYDVQQHEwlTdC4gTG91aXMxHzAdBgNV
+BAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4xDDAKBgNVBAsTA1RBTzEdMBsGA1UE
+AxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAaBgkqhkiG9w0BCQEWDWNhQG9jaXdl
+Yi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO4QS4bqrXVuBnHsOg1/
+gijXjiWhFTngG/sDLWAA52fHIobyFo5//7UaLedke0fkwqsmky8hjzSbXGJsGI5g
+Yjp2Va7WeJhRQNr8VYWobCq00f//drHN2NF5M23Cx0JF9WfyfWpqq5TQRGtVZ+We
++q4S6wH1exZrVGHfkp5Xq5FvAgMBAAGjggEAMIH9MB0GA1UdDgQWBBQvTY0YWmHq
+o2TMOKba/ECH9ayXZzCBzQYDVR0jBIHFMIHCgBQvTY0YWmHqo2TMOKba/ECH9ayX
+Z6GBpqSBozCBoDELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE1pc3NvdXJpMRIwEAYD
+VQQHEwlTdC4gTG91aXMxHzAdBgNVBAoTFk9iamVjdCBDb21wdXRpbmcsIEluYy4x
+DDAKBgNVBAsTA1RBTzEdMBsGA1UEAxMUQ2VydGlmeWluZyBBdXRob3JpdHkxHDAa
+BgkqhkiG9w0BCQEWDWNhQG9jaXdlYi5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkq
+hkiG9w0BAQQFAAOBgQBgjn97nbyyjFxyHC8vheAiDCQRblI4lZbZC6vSmxxqEGze
+eAMiTYL2iK3vj2Ot3V2/o5VdLyEYV4RBP2iq1XuMYXjmL2ni+NVgepyXceynH8/b
+72yciZZcDE5FVUaMUHAgZUpxsGSDyD70LnOFwBxuvxtlMtG5vXYNvwF/FJPs1g==
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/client.conf b/TAO/DevGuideExamples/Security/SecurityUnawareApp/client.conf
new file mode 100644
index 00000000000..78e939b5c7e
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/client.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:clientkey.pem -SSLCertificate PEM:clientcert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/client1.conf b/TAO/DevGuideExamples/Security/SecurityUnawareApp/client1.conf
new file mode 100644
index 00000000000..daafe5fdf58
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/client1.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate NONE -SSLPrivateKey PEM:clientkey.pem -SSLCertificate PEM:clientcert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientcert.pem b/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientcert.pem
new file mode 100644
index 00000000000..56616fcd469
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientcert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQQwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjIwN1oXDTEzMDgwNTAwMjIwN1owgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBmNs
+aWVudDEgMB4GCSqGSIb3DQEJARYRY2xpZW50QG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAMYaaQgEmp2zv0t+MAEGf5GIsKSIB1YFrkkVR6Qv
+LP0t9FHDPGFawh/aK3Yq+l7RiNpK1H5SSOaIavm4xV/3tpHxzuRjd0H3fdhaoAgD
+xvcYZ75l662PEa25MCJsp40tACO0hGNOQCJ8kWVmT4xEhKcFl3xm+1OvNbwDM/pA
+t4WpAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEArs6S6qud6D9t6AcGJS91XWqbBY1G
+rSgmv9yFbvUyrGAQuMpyNuYTGlZA+Nd3EAjYlwP4fWbzUMM0MEtd3Xl0Aep0O39W
+Cgp9HxDaJi3b4h63cd/B0su+2CNd4P6+NOX+IxgrrioCgKSnu6Nxy14fb03RQhjl
+a3vOY5Juf8ySB/M=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientkey.pem b/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientkey.pem
new file mode 100644
index 00000000000..2b4af2322ad
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/clientkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDGGmkIBJqds79LfjABBn+RiLCkiAdWBa5JFUekLyz9LfRRwzxh
+WsIf2it2Kvpe0YjaStR+UkjmiGr5uMVf97aR8c7kY3dB933YWqAIA8b3GGe+Zeut
+jxGtuTAibKeNLQAjtIRjTkAifJFlZk+MRISnBZd8ZvtTrzW8AzP6QLeFqQIDAQAB
+AoGAJx1X16lxDepLvxAvUkSCM64Vkqb5K9b7TprRBm36KBNGxk4SQfa1laxyIGbk
+AIzGxLM5uadtlXciCCSfdA9pEJbjtxSRJt2RbOWioT3sfIzXO7SCMHuuRjnPK3P8
+rgFmOOpo/ldVZ3mBJajxzWTEFXMUTAC4tB2j2B6of7MG5fECQQDu+uKzI2QjiTpW
+5WFd/vzpS2SpDHks4sEu0F6zk1Zhbsc3KoJd3xxSLhKFLLoRDVZsDKE3opr7WRNT
++sjoGRY3AkEA1DZArJqLeWuB8L8GjC/AtMXsxlSe3Iy9X+4uffZ/y5A1JbYidLJl
+3FlejMoQqp0EpbHO+mRCMSHyJqAFW1ZTHwJBANjv3oMHiYvIsrDXIQAWzLdqvUHI
+FOfuH7fDZ3RUN4HS8fzeFeHo+uiO8jj6VR3NoboL7P14GoA4aBc//MjUnRkCQQCH
+KZ770NtxFKaIvkLfWzL0cPQkRpWAiCu+RChclnpDH7CaOm2rwkzakhmEttbytFvX
+ZW8dUGpQfPyM2XNP/6WlAkEAoOQ5UI1WREbjoJs5mTwTG1gTrQjShQwjC0dqt66s
+bOS5os5EePGdctm//Xq7uR4/6hB6T7npPYqiyfWix1SINQ==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/run_test.pl b/TAO/DevGuideExamples/Security/SecurityUnawareApp/run_test.pl
new file mode 100644
index 00000000000..649bb7a1b04
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/run_test.pl
@@ -0,0 +1,62 @@
+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;
+
+$file = PerlACE::LocalFile("Messenger.ior");
+
+unlink $file;
+
+$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer",
+ "-ORBSvcConf server.conf");
+
+print STDERR "\n\nSecurity Unaware Application Examples\n";
+print STDERR "-------------------------------------\n";
+print STDERR "Starting Messenger Server...\n\n";
+
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($file, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient");
+
+$C1 = new PerlACE::Process("MessengerClient",
+ "-ORBSvcConf client.conf");
+
+$C2 = new PerlACE::Process("MessengerClient",
+ "-ORBSvcConf client1.conf");
+
+print STDERR "\nStarting MessengerClient, example 1...\n\n";
+if ($C->SpawnWaitKill(10) == 0) {
+ $S->Kill();
+ exit (1);
+}
+
+print STDERR "\nStarting MessengerClient, example 2...\n\n";
+if ($C1->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+$ENV{'SSL_CERT_FILE'} = '';
+
+print STDERR "\nStarting MessengerClient, example 3...\n\n";
+if ($C2->SpawnWaitKill(10) != 0) {
+ $S->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+
+exit 0;
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/server.conf b/TAO/DevGuideExamples/Security/SecurityUnawareApp/server.conf
new file mode 100644
index 00000000000..200fbd6cb8b
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/server.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:serverkey.pem -SSLCertificate PEM:servercert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/servercert.pem b/TAO/DevGuideExamples/Security/SecurityUnawareApp/servercert.pem
new file mode 100644
index 00000000000..9659fb07334
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/servercert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpzCCAhACAQMwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlVTMREwDwYD
+VQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZPYmpl
+Y3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xHTAbBgNVBAMTFENlcnRp
+ZnlpbmcgQXV0aG9yaXR5MRwwGgYJKoZIhvcNAQkBFg1jYUBvY2l3ZWIuY29tMB4X
+DTAzMDgwODAwMjAyOVoXDTEzMDgwNTAwMjAyOVowgZYxCzAJBgNVBAYTAlVTMREw
+DwYDVQQIEwhNaXNzb3VyaTESMBAGA1UEBxMJU3QuIExvdWlzMR8wHQYDVQQKExZP
+YmplY3QgQ29tcHV0aW5nLCBJbmMuMQwwCgYDVQQLEwNUQU8xDzANBgNVBAMTBlNl
+cnZlcjEgMB4GCSqGSIb3DQEJARYRc2VydmVyQG9jaXdlYi5jb20wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBAKw+tjwQz/stcesfm6WvnB6D/FTYu79tHzGUDlSV
+N+kycFYcZfsRmIEo5afG+epOwlp1f9Wpij23AMY4BcdcSP9R4yhH46uMFThQhkn9
+fraZ8slcgVog5G6MwXmsWb5gThjgiT0KPSQHkEU0bryw+CiM4oV+9dSaFBLa3Uqc
+iQZdAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAur+t7sIqGjqAPgFtFcgByAJTvNYb
+UDZ43AGd22tCtT/usoy/x9qsQv8jwd8kA8yUNQUmjRxR4vEkZ06L6HF8Ii1QmU/E
+fZ7YcjXjWxgnCEQGSXuHLhmlIMAlXNvX1XzNddu/NuRbSP3lYS/j32W8gTb6MdyL
+8bOkIqRpVY0ek80=
+-----END CERTIFICATE-----
diff --git a/TAO/DevGuideExamples/Security/SecurityUnawareApp/serverkey.pem b/TAO/DevGuideExamples/Security/SecurityUnawareApp/serverkey.pem
new file mode 100644
index 00000000000..c61b8152649
--- /dev/null
+++ b/TAO/DevGuideExamples/Security/SecurityUnawareApp/serverkey.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCsPrY8EM/7LXHrH5ulr5weg/xU2Lu/bR8xlA5UlTfpMnBWHGX7
+EZiBKOWnxvnqTsJadX/VqYo9twDGOAXHXEj/UeMoR+OrjBU4UIZJ/X62mfLJXIFa
+IORujMF5rFm+YE4Y4Ik9Cj0kB5BFNG68sPgojOKFfvXUmhQS2t1KnIkGXQIDAQAB
+AoGBAKjg08wQr9qVtBvT4ceRZoCE5+JIncwSMYNqpqJHq4n46iuDrHl9xwjcEE9v
+x5jzn5sRmUTj9aaMxzWRuBi/YtFVmgsl8lNiBOniIkFYqIyXfzNgX+2qyRzgOtAo
+0ByWFsqkLmW9cUXWaICkM49b9Jz7SnmPs+9VWGiNrjgJSiABAkEA4eFIc82mP2KJ
+wap8LJV7GLBA3iiVRmOgVb0TvRMitFWPGdGKFcsAVVkogQ/zIixKeZKc5enMhAI9
+i3Q2tmolZQJBAMM2hlSbJZncMjooKBlp2VZgUpEjbBPpD9XGgA5BO2RfKi3B29T9
+2v8I3m9WbCxbtFKlHcjNT3GToGCoi4S1qZkCQDcn7qwwZE8H/cFnoui0G5ncuApH
+eKP2gdlN0TsTKB9G4SmZzBEkP9GXcteJEIKgtBLZpSxTGdiGP4cE+rMyWi0CQDam
+TgbjhCxFq74CPe+XZWO8BYFiREByr58uOe1Dr8fSqHE040EGbEeXiQXsUM4+QgYc
++XCcoY/vPyewJ5bYcIkCQERqwlO9/JUiX2w01l82tMxVK8DmN3QwHWJxNexD5Ewf
+QFG6FYFPNHCR2f+MUSMFp1djUSVpCrWbppmlr96uZ48=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/DevGuideExamples/SmartProxies/Logger.idl b/TAO/DevGuideExamples/SmartProxies/Logger.idl
new file mode 100644
index 00000000000..e3e7c507324
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Logger.idl
@@ -0,0 +1,6 @@
+// Logger.idl
+
+interface Logger
+{
+ boolean log_message(in string message);
+};
diff --git a/TAO/DevGuideExamples/SmartProxies/LoggerServer.cpp b/TAO/DevGuideExamples/SmartProxies/LoggerServer.cpp
new file mode 100644
index 00000000000..9c88b257bca
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/LoggerServer.cpp
@@ -0,0 +1,45 @@
+// LoggerServer.cpp
+
+#include "Logger_i.h"
+#include <iostream>
+#include <fstream>
+int
+main(int argc, char * argv[])
+{
+ try {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Get a reference to Root POA.
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ // Activate the POA manager.
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ // Create a Logger_i servant.
+ Logger_i logger_servant;
+
+ // Register the servant with the RootPOA, obtain its object reference,
+ // stringify it, and write it to a file.
+ PortableServer::ObjectId_var oid = poa->activate_object(&logger_servant);
+ CORBA::Object_var logger_obj = poa->id_to_reference(oid.in());
+ CORBA::String_var str = orb->object_to_string(logger_obj.in());
+ std::ofstream iorFile("Logger.ior");
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Logger.ior" << std::endl;
+
+ // Accept requests from clients.
+ orb->run();
+
+ // Release resources.
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception:" << ex << std::endl;
+ return 1;
+ }
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/SmartProxies/Logger_i.cpp b/TAO/DevGuideExamples/SmartProxies/Logger_i.cpp
new file mode 100644
index 00000000000..6ccc4d8bf79
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Logger_i.cpp
@@ -0,0 +1,25 @@
+#include "Logger_i.h"
+#include <ace/OS_NS_time.h>
+#include <iostream>
+
+Logger_i::Logger_i (void)
+{
+ log_file.open("Logger.txt");
+}
+
+Logger_i::~Logger_i (void)
+{
+ log_file.close();
+}
+
+CORBA::Boolean Logger_i::log_message (const char * message)
+{
+ ACE_OS::time(&log_time);
+ log_time_string = ACE_OS::ctime(&log_time);
+ // Replace carriage return with string delimiter.
+ log_time_string[24] = '\0';
+ log_file << ACE_TEXT_ALWAYS_CHAR(log_time_string.c_str()) << " "
+ << message << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/SmartProxies/Logger_i.h b/TAO/DevGuideExamples/SmartProxies/Logger_i.h
new file mode 100644
index 00000000000..566d3f03912
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Logger_i.h
@@ -0,0 +1,25 @@
+#ifndef LOGGERI_H_
+#define LOGGERI_H_
+
+#include "LoggerS.h"
+#include <ace/String_Base.h>
+#include <fstream>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Logger_i : public virtual POA_Logger
+{
+public:
+ Logger_i (void);
+ virtual ~Logger_i (void);
+private:
+ ofstream log_file; // Output file stream to which messages are logged.
+ time_t log_time; // Needed for creating a time stamp.
+ ACE_TString log_time_string; // The time stamp string.
+
+virtual CORBA::Boolean log_message (const char * message);
+};
+#endif /* LOGGERI_H_ */
+
diff --git a/TAO/DevGuideExamples/SmartProxies/Messenger.idl b/TAO/DevGuideExamples/SmartProxies/Messenger.idl
new file mode 100644
index 00000000000..aaedd932648
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Messenger.idl
@@ -0,0 +1,9 @@
+// messenger.idl
+
+interface Messenger
+ {
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+ };
+
diff --git a/TAO/DevGuideExamples/SmartProxies/MessengerClient.cpp b/TAO/DevGuideExamples/SmartProxies/MessengerClient.cpp
new file mode 100644
index 00000000000..a2bbd89dfcb
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/MessengerClient.cpp
@@ -0,0 +1,50 @@
+
+#include "MessengerC.h"
+#include "Smart_Messenger_Proxy.h"
+
+#include <iostream>
+int ACE_TMAIN(int argc, ACE_TCHAR * argv[])
+{
+ try {
+ // Initialize the ORB
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ // Create a smart proxy factory. It will register itself with the
+ // smart proxy factory adapter so it can be used to create
+ // Messenger proxies. It must be created on the heap, but is
+ // otherwise unused here.
+ new Smart_Messenger_Proxy_Factory(orb.in());
+
+ // Convert the contents of the Messenger.ior file to an object reference.
+ CORBA::Object_var obj = orb->string_to_object("file://Messenger.ior");
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow the object reference to a Messenger object reference.
+ Messenger_var messenger = Messenger::_narrow(obj.in());
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Not a Messenger object reference" << std::endl;
+ return 1;
+ }
+
+ // Create a message and send it to the Messenger.
+ CORBA::String_var message = CORBA::string_dup("Hello!");
+ messenger->send_message ("TAO User", "TAO Test", message.inout());
+ std::cout << "Message was sent" << std::endl;
+
+ // Release resources.
+ orb->destroy();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+ catch(...) {
+ std::cerr << "Caught an unknown exception type" << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/SmartProxies/MessengerServer.cpp b/TAO/DevGuideExamples/SmartProxies/MessengerServer.cpp
new file mode 100644
index 00000000000..04843cce4a0
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/MessengerServer.cpp
@@ -0,0 +1,44 @@
+
+#include "Messenger_i.h"
+#include <iostream>
+#include <fstream>
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ //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();
+
+ // Create an object
+ Messenger_i messenger_servant;
+
+ // Write its strigified reference to a file
+ PortableServer::ObjectId_var oid =
+ poa->activate_object( &messenger_servant );
+ CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
+ CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
+ std::ofstream iorFile( "Messenger.ior" );
+ iorFile << str.in() << std::endl;
+ iorFile.close();
+ std::cout << "IOR written to file Messenger.ior" << std::endl;
+
+ // Accept requests
+ orb->run();
+ orb->destroy();
+ }
+
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Caught a CORBA exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/SmartProxies/Messenger_i.cpp b/TAO/DevGuideExamples/SmartProxies/Messenger_i.cpp
new file mode 100644
index 00000000000..08c2ad7fa96
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Messenger_i.cpp
@@ -0,0 +1,34 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include <iostream>
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (void)
+ {
+ }
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+ {
+ }
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ )
+{
+ //Add your implementation here
+ std::cerr << "Message from: " << user_name << std::endl;
+ std::cerr << "Subject: " << subject << std::endl;
+ std::cerr << "Message: " << message << std::endl;
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/SmartProxies/Messenger_i.h b/TAO/DevGuideExamples/SmartProxies/Messenger_i.h
new file mode 100644
index 00000000000..bab46846988
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Messenger_i.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (void);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message
+ );
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/DevGuideExamples/SmartProxies/README b/TAO/DevGuideExamples/SmartProxies/README
new file mode 100644
index 00000000000..b3927a9fdfc
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/README
@@ -0,0 +1,25 @@
+
+DevGuideExamples/SmartProxies/README
+
+The example in this directory extends the Messenger example in
+GettingStarted directory to use the Smart Proxy feature in TAO.
+
+A new Interface, Logger which supports an operation to log the messages
+(log_message) is used to log the information about the use of the
+Messenger.
+
+How to Run
+----------
+
+To start the logger server:
+---------------------------
+./LoggerServer
+
+To start the messenger server:
+-----------------------------
+./MessengerServer
+
+
+To start the messenger client:
+-----------------------------
+./MessengerClient
diff --git a/TAO/DevGuideExamples/SmartProxies/SmartProxies.mpc b/TAO/DevGuideExamples/SmartProxies/SmartProxies.mpc
new file mode 100644
index 00000000000..87c105c803a
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/SmartProxies.mpc
@@ -0,0 +1,42 @@
+// The server doesn't use Smart Proxies, but since the client
+// shares the idl generated source files, it needs to have the
+// -Gsp option added to the tao_idl flags.
+project(*Server): messaging, taoexe, portableserver, smart_proxies {
+ IDL_Files {
+ Messenger.idl
+ }
+
+ Source_Files {
+ MessengerC.cpp
+ MessengerS.cpp
+ Messenger_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, messaging, smart_proxies {
+ after += *Server *Logger
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ LoggerC.cpp
+ MessengerC.cpp
+ MessengerClient.cpp
+ Smart_Messenger_Proxy.cpp
+ }
+}
+
+project(*Logger): taoexe, portableserver {
+ IDL_Files {
+ Logger.idl
+ }
+
+ Source_Files {
+ LoggerC.cpp
+ LoggerS.cpp
+ Logger_i.cpp
+ LoggerServer.cpp
+ }
+}
diff --git a/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.cpp b/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.cpp
new file mode 100644
index 00000000000..7d46c96947b
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.cpp
@@ -0,0 +1,58 @@
+// Smart_Messenger_Proxy.cpp
+
+#include "Smart_Messenger_Proxy.h"
+#include <iostream>
+
+Smart_Messenger_Proxy_Factory::Smart_Messenger_Proxy_Factory(
+ CORBA::ORB_ptr orb)
+{
+ std::cout << "Creating smart proxy factory" << std::endl;
+ // Convert the contents of the Logger.ior file to an object reference.
+ CORBA::Object_var obj = orb->string_to_object("file://Logger.ior");
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Logger reference" << std::endl;
+ throw 0;
+ }
+
+ // Narrow the object reference to a Logger object reference.
+ logger_ = Logger::_narrow(obj.in());
+ if (CORBA::is_nil(logger_.in ())) {
+ std::cerr << "Not a Logger object reference" << std::endl;
+ throw 0;
+ }
+}
+
+Messenger_ptr
+Smart_Messenger_Proxy_Factory::create_proxy (
+ Messenger_ptr proxy)
+{
+
+ Messenger_ptr smart_proxy = 0;
+ if (CORBA::is_nil(proxy) == 0)
+ smart_proxy = new Smart_Messenger_Proxy(proxy, logger_.in());
+ return smart_proxy;
+}
+
+
+Smart_Messenger_Proxy::Smart_Messenger_Proxy(
+ Messenger_ptr proxy, Logger_ptr logger)
+ : TAO_Smart_Proxy_Base(proxy),
+ logger_(Logger::_duplicate(logger))
+{
+ std::cout << "Creating smart proxy" << std::endl;
+}
+
+CORBA::Boolean
+Smart_Messenger_Proxy::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException)
+{
+ logger_->log_message("Before send_message()");
+ CORBA::Boolean ret_val =
+ TAO_Messenger_Smart_Proxy_Base::send_message(user_name, subject, message);
+ logger_->log_message("After send_message()");
+ return ret_val;
+}
+
diff --git a/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.h b/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.h
new file mode 100644
index 00000000000..d75d682b9e6
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/Smart_Messenger_Proxy.h
@@ -0,0 +1,30 @@
+// Smart_Messenger_Proxy.h
+
+
+#include "MessengerC.h"
+#include "LoggerC.h"
+
+class Smart_Messenger_Proxy_Factory : public TAO_Messenger_Default_Proxy_Factory
+{
+ public:
+ Smart_Messenger_Proxy_Factory(CORBA::ORB_ptr orb);
+ virtual Messenger_ptr create_proxy (
+ Messenger_ptr proxy);
+ private:
+ Logger_var logger_;
+};
+
+
+class Smart_Messenger_Proxy : public TAO_Messenger_Smart_Proxy_Base
+{
+ public:
+ Smart_Messenger_Proxy(Messenger_ptr proxy, Logger_ptr logger);
+ virtual CORBA::Boolean send_message(
+ const char * user_name,
+ const char * subject,
+ char *& message)
+ throw (CORBA::SystemException);
+ private:
+ Logger_var logger_;
+};
+
diff --git a/TAO/DevGuideExamples/SmartProxies/run_test.pl b/TAO/DevGuideExamples/SmartProxies/run_test.pl
new file mode 100644
index 00000000000..b8c8805859c
--- /dev/null
+++ b/TAO/DevGuideExamples/SmartProxies/run_test.pl
@@ -0,0 +1,52 @@
+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;
+
+
+$M_ior = "Messenger.ior";
+$L_ior = "Logger.ior";
+
+unlink $M_ior;
+unlink $L_ior;
+
+# start MessengerServer
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+if (PerlACE::waitforfile_timed ($M_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $M_ior\n";
+ $S->Kill();
+ exit 1;
+}
+
+# start LoggerServer
+$L = new PerlACE::Process("LoggerServer");
+$L->Spawn();
+if (PerlACE::waitforfile_timed ($L_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file $L_ior\n";
+ $L->Kill();
+ $S->Kill();
+ exit 1;
+}
+
+# start MessengerClient
+$C = new PerlACE::Process("MessengerClient");
+if ($C->SpawnWaitKill(20) != 0) {
+ $S->Kill();
+ $L->Kill();
+ exit (1);
+}
+
+# clean-up
+$S->Kill();
+$L->Kill();
+unlink $M_ior;
+unlink $L_ior;
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/README b/TAO/DevGuideExamples/ValueTypes/Bank/README
new file mode 100644
index 00000000000..da6620be9ed
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/README
@@ -0,0 +1,35 @@
+A simple example using valuetypes.
+
+
+How to Run
+----------
+
+Start the server :
+------------------
+./server
+
+
+Start the client:
+------------------
+./client
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/_pch.cpp b/TAO/DevGuideExamples/ValueTypes/Bank/_pch.cpp
new file mode 100644
index 00000000000..e7b3cbd31cc
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/_pch.cpp
@@ -0,0 +1 @@
+#include "_pch.h"
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/_pch.h b/TAO/DevGuideExamples/ValueTypes/Bank/_pch.h
new file mode 100644
index 00000000000..1b4e8d10348
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/_pch.h
@@ -0,0 +1,10 @@
+#ifndef PCH_H
+#define PCH_H
+
+#ifdef USING_PCH
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+#include <tao/Stub.h>
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/bank.idl b/TAO/DevGuideExamples/ValueTypes/Bank/bank.idl
new file mode 100644
index 00000000000..272243e953a
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/bank.idl
@@ -0,0 +1,13 @@
+valuetype Person {
+
+ public string name;
+ public long balance;
+
+ factory create(in string name);
+
+ void debit(in long amt);
+};
+
+interface Transaction {
+ long update(in Person p);
+};
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/bank.mpc b/TAO/DevGuideExamples/ValueTypes/Bank/bank.mpc
new file mode 100644
index 00000000000..ddd7b27acb3
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/bank.mpc
@@ -0,0 +1,17 @@
+project(*_Dev_Server): taoexe, portableserver, valuetype, avoids_minimum_corba {
+ idlflags += -Wb,pch_include=_pch.h
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*_Dev_Client): taoexe, portableserver, valuetype, avoids_minimum_corba {
+ after += *_Dev_Server
+
+ Source_Files {
+ client.cpp
+ bankC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/client.cpp b/TAO/DevGuideExamples/ValueTypes/Bank/client.cpp
new file mode 100644
index 00000000000..38f0a7192f7
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/client.cpp
@@ -0,0 +1,67 @@
+#include "_pch.h"
+
+#include "bankC.h"
+
+#include <iostream>
+#include <stdexcept>
+
+
+// Note : We use a completely different implementation
+// of the Person valuetype for the client side, just to
+// show that this is possible.
+class Person_i
+ : public virtual OBV_Person
+ , public virtual CORBA::DefaultValueRefCountBase
+{
+public:
+ Person_i(const char* n, CORBA::Long bal)
+ {
+ name(n);
+ balance(bal);
+ }
+private:
+ void debit(CORBA::Long)
+ {
+ throw std::runtime_error("Not supported.");
+ }
+};
+
+const char* server_ior = "file://server.ior";
+
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ try {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ CORBA::Object_var obj = orb->string_to_object(server_ior);
+ Transaction_var trans = Transaction::_narrow(obj.in());
+ if (CORBA::is_nil(trans.in()))
+ throw std::runtime_error("failed to find a valid Transaction IOR");
+
+ Person_var p = new Person_i("TAOUser", 1000);
+
+ const char* n = p->name();
+ double bal = p->balance() / 100.0;
+ std::cout << "Client: Sending person:" << n
+ << " starting_balance:$" << bal
+ << std::endl;
+
+ CORBA::Long b = trans->update(p.in());
+
+ while (orb->work_pending()) {
+ orb->perform_work();
+ }
+
+ std::cout << "Client: Ending balance: " << b/100.0 << std::endl;
+
+ orb->destroy();
+
+ } catch(const CORBA::Exception& e) {
+ std::cerr << e << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/run_test.pl b/TAO/DevGuideExamples/ValueTypes/Bank/run_test.pl
new file mode 100644
index 00000000000..7a13320b164
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/run_test.pl
@@ -0,0 +1,37 @@
+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;
+$ior = "server.ior";
+$S = new PerlACE::Process("server");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+$C = new PerlACE::Process("client");
+$C->Spawn();
+
+$CRET = $C->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Bank/server.cpp b/TAO/DevGuideExamples/ValueTypes/Bank/server.cpp
new file mode 100644
index 00000000000..6c0d38c657c
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Bank/server.cpp
@@ -0,0 +1,101 @@
+#include "_pch.h"
+
+#include "bankS.h"
+
+#include <tao/AnyTypeCode/TypeCode.h>
+#include <ace/OS_NS_stdio.h>
+#include <iostream>
+#include <fstream>
+#include <fstream>
+
+const char* server_ior_file = "server.ior";
+
+
+class Person_i
+ : public virtual OBV_Person
+ , public virtual CORBA::DefaultValueRefCountBase
+{
+public:
+ void debit(CORBA::Long amt)
+ {
+ CORBA::Long tmp = balance();
+ tmp -= amt;
+ balance(tmp);
+ }
+};
+
+class PersonFactory
+ : public virtual Person_init
+{
+ Person* create(const char* name)
+ ACE_THROW_SPEC((CORBA::SystemException))
+ {
+ Person_i* p = new Person_i;
+ p->name(name);
+ return p;
+ }
+
+ CORBA::ValueBase * create_for_unmarshal()
+ {
+ // It doesn't matter what values we construct it with
+ // because they will be overwritten with the demarshaled values.
+ return new Person_i;
+ }
+};
+
+class Transaction_i
+ : public virtual POA_Transaction
+{
+public:
+ CORBA::Long update(Person* p)
+ ACE_THROW_SPEC((CORBA::SystemException))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Server: Subtracting $1.50 from person:%s starting balance:$%.2f\n",
+ p->name(),
+ p->balance() / 100.0));
+ p->debit(150);
+ return p->balance();
+ }
+};
+
+void write_ior(const char* ior) {
+ std::ofstream out(server_ior_file);
+ out << ior;
+}
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ {
+ CORBA::ValueFactoryBase_var factory = new PersonFactory;
+ CORBA::String_var id = _tc_Person->id();
+ orb->register_value_factory(id.in(), factory.in());
+ }
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var poaman = poa->the_POAManager();
+
+ Transaction_i svt;
+
+ {
+ PortableServer::ObjectId_var id = poa->activate_object(&svt);
+ obj = poa->id_to_reference(id.in());
+ CORBA::String_var ior = orb->object_to_string(obj.in());
+ write_ior(ior.in());
+ }
+
+ std::cout << "Server: Running..." << std::endl;
+
+ poaman->activate();
+
+ orb->run();
+
+ poa->destroy(1, 1);
+ orb->destroy();
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.cpp b/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.cpp
new file mode 100644
index 00000000000..e1953612e12
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.cpp
@@ -0,0 +1,96 @@
+#include "_pch.h"
+#include "Message_i.h"
+#include "MessengerC.h"
+
+#include <tao/AnyTypeCode/TypeCode.h>
+
+#include <iostream>
+
+MessageImpl::MessageImpl()
+{
+}
+
+MessageImpl::~MessageImpl()
+{
+}
+
+MessageImpl::MessageImpl
+(const char* address,
+ const char* user,
+ const char* subject,
+ const char* txt
+ )
+{
+ addAddress(address);
+ user_(user);
+ subject_(subject);
+ text_(txt);
+}
+
+Message::AddrList* MessageImpl::getAddresses() {
+ return new AddrList(addrs_());
+}
+
+void MessageImpl::addAddress(const char* s) {
+ AddrList& al = addrs_();
+ CORBA::ULong idx = al.length();
+ al.length(idx + 1);
+ al[idx] = s;
+}
+
+char* MessageImpl::user() {
+ return CORBA::string_dup(user_());
+}
+void MessageImpl::user(const char* s) {
+ user_(s);
+}
+
+char* MessageImpl::subject() {
+ return CORBA::string_dup(subject_());
+}
+void MessageImpl::subject(const char* s) {
+ subject_(s);
+}
+
+char* MessageImpl::text() {
+ return CORBA::string_dup(text_());
+}
+void MessageImpl::text(const char* s) {
+ text_(s);
+}
+
+void MessageImpl::print() {
+
+ std::cout << "Message from : " << user_() << std::endl;
+
+ AddrList& addrs = addrs_();
+ if (addrs.length() > 0) {
+ std::cout << "\tTo : ";
+ for (CORBA::ULong i = 0; i < addrs.length(); ++i) {
+ CORBA::String_var s = CORBA::string_dup(addrs[i]);
+ std::cout << s.in() << ";";
+ }
+ std::cout << std::endl;
+ }
+
+ std::cout << "\tSubject : " << subject_() << std::endl;
+ std::cout << "\tText : " << text_() << std::endl;
+}
+
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+
+void
+MessageFactory::register_new_factory(CORBA::ORB& orb) {
+ CORBA::ValueFactoryBase_var mf = new MessageFactory;
+ CORBA::String_var id = _tc_Message->id();
+ orb.register_value_factory(id.in(), mf.in());
+}
+
+CORBA::ValueBase*
+MessageFactory::create_for_unmarshal()
+{
+ return new MessageImpl;
+}
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.h b/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.h
new file mode 100644
index 00000000000..4fd1206af8c
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/Message_i.h
@@ -0,0 +1,47 @@
+#ifndef MESSAGE_I_H
+#define MESSAGE_I_H
+
+#include "MessengerC.h"
+
+#include <tao/Valuetype/ValueFactory.h>
+
+class MessageImpl : public virtual OBV_Message,
+ public virtual CORBA::DefaultValueRefCountBase
+{
+public:
+ MessageImpl();
+
+ MessageImpl(
+ const char* address,
+ const char* user,
+ const char* subject,
+ const char* txt
+ );
+
+ virtual ::Message::AddrList* getAddresses();
+ virtual void addAddress(const char*);
+
+ virtual char* user();
+ virtual void user(const char*);
+
+ virtual char* subject();
+ virtual void subject(const char*);
+
+ virtual char* text();
+ virtual void text(const char*);
+
+ virtual void print();
+protected:
+ virtual ~MessageImpl();
+};
+
+class MessageFactory
+ : public virtual CORBA::ValueFactoryBase
+{
+public:
+ static void register_new_factory(CORBA::ORB& orb);
+private:
+ virtual CORBA::ValueBase* create_for_unmarshal();
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger.idl b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger.idl
new file mode 100644
index 00000000000..e6a63fc9278
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger.idl
@@ -0,0 +1,27 @@
+// Messenger.idl
+// Modified to make use of ValueTypes
+
+// Demonstrates how ValueTypes can let you make wrapper classes
+// that make sequences easier to work with, and can simplify
+// IDL interfaces by reducing the number of parameters.
+
+valuetype Message {
+ typedef sequence<string> AddrList;
+
+ private AddrList addrs_;
+ private string user_;
+ private string subject_;
+ private string text_;
+
+ AddrList getAddresses();
+ void addAddress(in string address);
+ attribute string user;
+ attribute string subject;
+ attribute string text;
+ void print();
+};
+
+interface Messenger {
+ boolean send_message(inout Message msg);
+};
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerClient.cpp b/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerClient.cpp
new file mode 100644
index 00000000000..9b2838b5d64
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerClient.cpp
@@ -0,0 +1,46 @@
+#include "_pch.h"
+#include "Message_i.h"
+#include <iostream>
+
+const char* server_ior = "file://server.ior";
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ try {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ // Normally we wouldn't have to register the factory in the client, but
+ // in this case the valuetype will be returned as an inout parameter, and
+ // we'll need the factory to support this.
+ MessageFactory::register_new_factory(* orb.in());
+
+ CORBA::Object_var obj = orb->string_to_object(server_ior);
+ Messenger_var tst = Messenger::_narrow(obj.in());
+ ACE_ASSERT(! CORBA::is_nil(tst.in()));
+
+ Message_var msg = new MessageImpl("Son", "Mom", "Dinner's Ready.", "Hurry home.");
+
+ if (tst->send_message(msg)) {
+
+ std::cout << "Message sent successfully.\n";
+ msg->print();
+ std::cout << std::endl;
+
+ } else {
+ std::cout << "Message refused." << std::endl;
+ }
+
+ while (orb->work_pending()) {
+ orb->perform_work();
+ }
+
+ orb->destroy();
+
+ } catch(const CORBA::Exception& e) {
+ std::cerr << e << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerServer.cpp b/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerServer.cpp
new file mode 100644
index 00000000000..e7d35db3cbc
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/MessengerServer.cpp
@@ -0,0 +1,46 @@
+#include "_pch.h"
+
+#include "Messenger_i.h"
+#include "Message_i.h"
+
+#include <iostream>
+#include <fstream>
+#include <fstream>
+
+const char* server_ior_file = "server.ior";
+
+
+void write_ior(const char* ior) {
+ std::ofstream out(server_ior_file);
+ out << ior;
+}
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ MessageFactory::register_new_factory(* orb.in());
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var poaman = poa->the_POAManager();
+
+ Messenger_i svt;
+
+ PortableServer::ObjectId_var id = poa->activate_object(&svt);
+ obj = poa->id_to_reference(id.in());
+ CORBA::String_var ior = orb->object_to_string(obj.in());
+ write_ior(ior.in());
+
+ std::cout << "Starting server." << std::endl;
+
+ poaman->activate();
+
+ orb->run();
+
+ poa->destroy(1, 1);
+ orb->destroy();
+
+ return 0;
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.cpp b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.cpp
new file mode 100644
index 00000000000..fa401a63c98
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.cpp
@@ -0,0 +1,25 @@
+#include "_pch.h"
+
+#include "Messenger_i.h"
+
+#include <sstream>
+
+
+CORBA::Boolean Messenger_i::send_message (Message*& msg)
+ throw (CORBA::SystemException)
+{
+ msg->print();
+
+ msg->user("Son");
+ msg->addAddress("Mom");
+ msg->addAddress("Dad");
+
+ std::ostringstream out;
+ CORBA::String_var sub = msg->subject();
+ out << "RE: " << sub.in();
+ msg->subject(out.str().c_str());
+ msg->text("Ok. I'm on my way.");
+
+ return 1;
+}
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.h b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.h
new file mode 100644
index 00000000000..3e94ca527ce
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/Messenger_i.h
@@ -0,0 +1,13 @@
+#ifndef MESSENGER_I_H_
+#define MESSENGER_I_H_
+
+#include "MessengerS.h"
+
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ virtual CORBA::Boolean send_message(Message*& msg)
+ throw (CORBA::SystemException);
+};
+
+#endif
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/README b/TAO/DevGuideExamples/ValueTypes/Messenger/README
new file mode 100644
index 00000000000..77221f1a9b0
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/README
@@ -0,0 +1,44 @@
+This directory contains a CORBA example illustrating a simple client and
+a server with a Interface Messenger. The Messenger Interface has
+an operation for sending a message (send_message). The MessengerClient
+will send a message which is displayed by the MessengerServer when
+received. The MessengerClient will then confirm that the message has
+been sent successfully.
+
+This version of the example has been modified to use a new ValueType called
+Message that encapsulates the message information. The send method on
+Messenger has been modified to take a single Message inout parameter.
+
+
+How to Run
+----------
+
+Start the server :
+------------------
+./server
+
+
+Start the client:
+------------------
+./client
+
+
+
+Exeuction via Perl Script
+-------------------------
+
+A Perl script has been created to automate the steps shown
+above. This script can be run via the following command:
+
+./run_test.pl
+
+
+NOTE:
+
+ If you run on Windows platform, go to Debug or Release directory to run the
+ script via following command:
+
+ perl ../run_test.pl
+
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/ValueTypes.mpc b/TAO/DevGuideExamples/ValueTypes/Messenger/ValueTypes.mpc
new file mode 100644
index 00000000000..4a4afb027d0
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/ValueTypes.mpc
@@ -0,0 +1,20 @@
+project(*Server): taoexe, portableserver, valuetype, avoids_minimum_corba {
+ idlflags += -Wb,pch_include=_pch.h
+ Source_Files {
+ Messenger_i.cpp
+ Message_i.cpp
+ MessengerServer.cpp
+ }
+}
+
+project(*Client): taoexe, valuetype, avoids_minimum_corba {
+ after += ValueTypes_Server
+
+ Source_Files {
+ Message_i.cpp
+ MessengerC.cpp
+ MessengerClient.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.cpp b/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.cpp
new file mode 100644
index 00000000000..e7b3cbd31cc
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.cpp
@@ -0,0 +1 @@
+#include "_pch.h"
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.h b/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.h
new file mode 100644
index 00000000000..1b4e8d10348
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/_pch.h
@@ -0,0 +1,10 @@
+#ifndef PCH_H
+#define PCH_H
+
+#ifdef USING_PCH
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+#include <tao/Stub.h>
+#endif
+
+#endif
diff --git a/TAO/DevGuideExamples/ValueTypes/Messenger/run_test.pl b/TAO/DevGuideExamples/ValueTypes/Messenger/run_test.pl
new file mode 100644
index 00000000000..c2a973cf1a8
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Messenger/run_test.pl
@@ -0,0 +1,37 @@
+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;
+$ior = "server.ior";
+$S = new PerlACE::Process("MessengerServer");
+$S->Spawn();
+
+if (PerlACE::waitforfile_timed ($ior, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$ior>\n";
+ $S->Kill();
+ unlink $ior;
+ exit 1;
+}
+
+$C = new PerlACE::Process("MessengerClient");
+$C->Spawn();
+
+$CRET = $C->WaitKill(15);
+$S->Kill();
+
+# clean-up
+
+unlink $ior;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/Event.idl b/TAO/DevGuideExamples/ValueTypes/Notify/Event.idl
new file mode 100644
index 00000000000..0d2c0122876
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/Event.idl
@@ -0,0 +1,14 @@
+
+#include <tao/LongSeq.pidl>
+
+valuetype MyEvent
+{
+ public string name;
+ public long kind;
+ private CORBA::LongSeq payload;
+
+ void dump();
+ long size();
+ void add_long(in long n);
+};
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/Event_i.h b/TAO/DevGuideExamples/ValueTypes/Notify/Event_i.h
new file mode 100644
index 00000000000..1822b8381ab
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/Event_i.h
@@ -0,0 +1,64 @@
+#ifndef EVENT_H_
+#define EVENT_H_
+
+#include "EventS.h"
+
+#include <iostream>
+#include <tao/Valuetype/ValueFactory.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class MyEvent_i
+ : public virtual OBV_MyEvent
+ , public virtual CORBA::DefaultValueRefCountBase
+{
+public:
+ MyEvent_i(const char* n, CORBA::Long k)
+ {
+ name(n);
+ kind(k);
+ }
+
+ virtual void dump ()
+ {
+ CORBA::LongSeq& pl = payload();
+ ACE_DEBUG((LM_DEBUG, "\nPayload contents.\n"));
+ for (CORBA::ULong i = 0; i < pl.length(); ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "%d = %d\n", i, pl[i]));
+ }
+ ACE_DEBUG((LM_DEBUG, "\n"));
+ }
+
+ virtual CORBA::Long size ()
+ {
+ return payload().length();
+ }
+
+ virtual void add_long (CORBA::Long n)
+ {
+ CORBA::LongSeq& pl = payload();
+ CORBA::ULong idx = pl.length();
+ pl.length(idx + 1);
+ pl[idx] = n;
+ }
+};
+
+class MyEventFactory
+ : public virtual CORBA::ValueFactoryBase
+{
+public:
+
+ virtual CORBA::ValueBase * create_for_unmarshal ()
+ {
+ // It doesn't matter what values we construct it with
+ // because they will be overwritten with the demarshaled values.
+ return new MyEvent_i("", -1);
+ }
+};
+
+
+#endif /* EVENT_H_ */
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/Notify.mpc b/TAO/DevGuideExamples/ValueTypes/Notify/Notify.mpc
new file mode 100644
index 00000000000..329f3d5f8bb
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/Notify.mpc
@@ -0,0 +1,20 @@
+project(*supplier) : taoexe, portableserver, valuetype, notify, portableserver, event_skel {
+ exename = supplier
+ source_files {
+ supplier.cpp
+ }
+ header_files {
+ Event_i.h
+ }
+}
+
+project(*consumer) : taoexe, portableserver, valuetype, notify, portableserver, event_skel {
+ exename = consumer
+ source_files {
+ consumer.cpp
+ }
+ header_files {
+ Event_i.h
+ }
+}
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/consumer.cpp b/TAO/DevGuideExamples/ValueTypes/Notify/consumer.cpp
new file mode 100644
index 00000000000..ec8b66df1e9
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/consumer.cpp
@@ -0,0 +1,177 @@
+// This supplier requires that the Notify_Service is started with
+// -IOROutput notify.ior -channel -nonamesvc
+// at minimum.
+const char* notify_ior = "corbaloc::localhost:8888/NotifyEventChannelFactory";
+
+#include "Event_i.h"
+
+#include <orbsvcs/CosEventCommS.h>
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+
+#include <iostream>
+#include <stdexcept>
+
+const char* ec_ior_output_file = "ec.ior";
+
+class TestConsumer : public POA_CosEventComm::PushConsumer
+{
+ int num_events_;
+
+ CosEventChannelAdmin::ConsumerAdmin_var admin_;
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ PortableServer::ObjectId_var id_;
+ int event_count_;
+ bool connected_;
+ PortableServer::POA_ptr poa_;
+ CORBA::ORB_ptr orb_;
+public:
+
+ TestConsumer(int evts,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf,
+ PortableServer::POA_ptr poa,
+ CORBA::ORB_ptr orb)
+ : num_events_(evts)
+ , event_count_(0)
+ , connected_(false)
+ , poa_(poa)
+ , orb_(orb)
+ {
+ if (CORBA::is_nil(ecf))
+ throw std::invalid_argument("TestConsumer::CTOR: is_nil(ecf)");
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ CosEventChannelAdmin::EventChannel_var ec
+ = ecf->create_channel (initial_qos,
+ initial_admin,
+ id);
+
+ CORBA::String_var ior = orb_->object_to_string (ec.in());
+
+ // If the ec_ior_output_file exists, output the ior to it
+ if (ec_ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ec_ior_output_file, ACE_TEXT("w"));
+ if (output_file == 0)
+ throw std::invalid_argument("Cannot open channel ior output file");
+
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "TestConsumer: write channel ior to file %s\n", ec_ior_output_file));
+
+ admin_ = ec->for_consumers();
+ CORBA::Object_var obj = admin_->obtain_push_supplier();
+ supplier_ = CosEventChannelAdmin::ProxyPushSupplier::_unchecked_narrow(obj.in());
+
+ id_ = poa->activate_object(this);
+ obj = poa->id_to_reference(id_.in());
+ CosEventComm::PushConsumer_var consumer = CosEventComm::PushConsumer::_narrow(obj.in());
+
+ supplier_->connect_push_consumer(consumer.in());
+ connected_ = true;
+ }
+
+ virtual ~TestConsumer() {
+ }
+
+ virtual void disconnect_push_consumer()
+ throw (CORBA::SystemException)
+ {
+ std::cout << "disconnect_push_consumer()." << std::endl;
+ }
+
+ virtual void push(const CORBA::Any& a)
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+ {
+ MyEvent* vt;
+ a >>= vt;
+
+ std::cout << std::endl
+ << "Received MyEvent name=" << vt->name()
+ << ", kind=" << vt->kind()
+ << ", size=" << vt->size()
+ << std::endl;
+
+ vt->dump();
+
+ if ( ++ event_count_ >= num_events_ && num_events_ > 0) {
+ std::cout << "Consumer disconnecting after receiving "
+ << event_count_ << " events." << std::endl;
+ disconnect();
+ }
+ }
+
+ void disconnect() {
+ try {
+ if (connected_) {
+ connected_ = false;
+ poa_->deactivate_object(id_.in());
+ supplier_->disconnect_push_supplier();
+ orb_->shutdown(0);
+ std::cout << "Consumer disconnected." << std::endl;
+ }
+ } catch(const CORBA::Exception& e) {
+ std::cerr << "TestConsumer::disconnect() exception: " << e << std::endl;
+ }
+ }
+
+ void disconnect_self() {
+ }
+
+};
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ int num_events = 0;
+
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ CORBA::ValueFactoryBase_var factory = new MyEventFactory;
+ CORBA::String_var id = _tc_MyEvent->id();
+ orb->register_value_factory(id.in(), factory.in());
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa =
+ PortableServer::POA::_unchecked_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+
+ obj = orb->string_to_object(notify_ior);
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf
+ = CosNotifyChannelAdmin::EventChannelFactory::_unchecked_narrow(obj.in());
+
+ if (ac > 1) {
+ num_events = ACE_OS::atoi(av[1]);
+ }
+
+ mgr->activate();
+
+ {
+ TestConsumer consumer(num_events, ecf.in(), poa.in(), orb.in());
+ ACE_Time_Value tvMaxRunTime(300);
+ orb->run(tvMaxRunTime);
+ }
+
+ poa->destroy(1, 1);
+ orb->destroy();
+
+ return 0;
+
+ } catch(const CORBA::Exception& e) {
+ std::cerr << "Consumer: main() exception: " << e << std::endl;
+ } catch(const std::invalid_argument& e) {
+ std::cerr << "Consumer: main() exception: " << e.what () << std::endl;
+ } catch(...) {
+ std::cerr << "Consumer: main() unknown exception: " << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/notify.conf b/TAO/DevGuideExamples/ValueTypes/Notify/notify.conf
new file mode 100644
index 00000000000..3d7c070a962
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/notify.conf
@@ -0,0 +1,2 @@
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1 -SourceThreads 0 "
+
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/readme.txt b/TAO/DevGuideExamples/ValueTypes/Notify/readme.txt
new file mode 100644
index 00000000000..3a138e3a373
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/readme.txt
@@ -0,0 +1,2 @@
+This test uses valuetypes within simple CosEC::Any events passed through the
+notification service.
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/run_test.pl b/TAO/DevGuideExamples/ValueTypes/Notify/run_test.pl
new file mode 100644
index 00000000000..daab0c80126
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/run_test.pl
@@ -0,0 +1,79 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+use Env(ACE_ROOT);
+use Env (TAO_ROOT);
+use lib "$ACE_ROOT/bin";
+use PerlACE::Run_Test;
+
+my $ec_ior = PerlACE::LocalFile ("ec.ior");
+my $notifyior = PerlACE::LocalFile ("notify.ior");
+my $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+
+my $TS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service",
+ "-boot -orbendpoint iiop://:8888 -NoNameSvc -IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+my $SUP = new PerlACE::Process ("supplier");
+my $CONS = new PerlACE::Process ("consumer");
+
+unlink $ec_ior;
+unlink $notifyior;
+
+$TS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ $TS->Kill ();
+ exit 1;
+}
+
+print "****** Running consumer ******\n";
+
+## The consumer takes one argument indicating
+## how many events to receive before disconnecting.
+
+$CONS->Arguments("5");
+my $client = $CONS->Spawn();
+if ($client != 0) {
+ $TS->Kill ();
+ exit 1;
+}
+
+## The supplier needs wait after the consumer creates the event channel.
+if (PerlACE::waitforfile_timed ($ec_ior, 20) == -1) {
+ $TS->Kill ();
+ $client->Kill ();
+ exit 1;
+}
+
+## The supplier takes two arguments.
+## The first indicates how many events to push.
+## The second indicates the payload size. (The payload is sequence<int>)
+
+print "****** Running supplier ******\n";
+
+$SUP->Arguments("10 5");
+my $server = $SUP->Spawn();
+if ($server != 0) {
+ $TS->Kill();
+ $CONS->Kill();
+ exit 1;
+}
+
+$CONS->WaitKill(30);
+
+
+$server = $SUP->WaitKill(30);
+if ($server != 0) {
+ $TS->Kill();
+ $CONS->Kill();
+ exit 1;
+}
+
+$TS->Kill ();
+
+unlink $ec_ior;
+unlink $notifyior;
+exit 0;
diff --git a/TAO/DevGuideExamples/ValueTypes/Notify/supplier.cpp b/TAO/DevGuideExamples/ValueTypes/Notify/supplier.cpp
new file mode 100644
index 00000000000..cafeb451c2c
--- /dev/null
+++ b/TAO/DevGuideExamples/ValueTypes/Notify/supplier.cpp
@@ -0,0 +1,214 @@
+// This supplier requires that the Notify_Service is started with
+// -IOROutput notify.ior -channel -nonamesvc
+// at minimum.
+const char* notify_ior = "corbaloc::localhost:8888/NotifyEventChannelFactory";
+
+#include "Event_i.h"
+
+#include <orbsvcs/CosEventCommS.h>
+
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+
+#include <tao/corba.h>
+#include <tao/ORB_Core.h>
+
+#include <ace/Reactor.h>
+#include <ace/Event_Handler.h>
+#include <iostream>
+#include <stdexcept>
+
+const ACE_Time_Value EVENT_DELAY(0, 10 * 1000);
+
+static MyEvent_var event_;
+
+const char* ec_ior = "file://ec.ior";
+
+class TestSupplier
+: public POA_CosEventComm::PushSupplier
+, public ACE_Event_Handler
+{
+ int num_events_;
+
+ CosEventChannelAdmin::SupplierAdmin_var admin_;
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_;
+ PortableServer::ObjectId_var id_;
+ int event_count_;
+ bool connected_;
+ ACE_Reactor* reactor_;
+ PortableServer::POA_ptr poa_;
+ CORBA::ORB_ptr orb_;
+
+public:
+
+ TestSupplier(int evts, CosNotifyChannelAdmin::EventChannelFactory_ptr ecf,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+ : num_events_(evts)
+ , event_count_(0)
+ , connected_(false)
+ , reactor_(orb->orb_core()->reactor())
+ , poa_(poa)
+ , orb_(orb)
+ {
+ if (reactor_ == 0 || CORBA::is_nil (ecf))
+ throw std::invalid_argument("TestSupplier::CTOR: reactor == 0 || CORBA::is_nil(ecf)");
+
+ CORBA::Object_var obj =
+ this->orb_->string_to_object (ec_ior);
+
+ ACE_DEBUG((LM_DEBUG, "TestSupplier: string_to_object from %s\n", ec_ior));
+
+ CosNotifyChannelAdmin::EventChannel_var ec
+ = CosNotifyChannelAdmin::EventChannel::_unchecked_narrow (obj.in ());
+
+ admin_ = ec->for_suppliers();
+ obj = admin_->obtain_push_consumer();
+ consumer_ = CosEventChannelAdmin::ProxyPushConsumer::_unchecked_narrow(obj.in());
+ id_ = poa->activate_object(this);
+ obj = poa->id_to_reference(id_.in());
+ CosEventComm::PushSupplier_var supplier =
+ CosEventComm::PushSupplier::_unchecked_narrow(obj.in());
+
+ consumer_->connect_push_supplier(supplier.in());
+ connected_ = true;
+
+ schedule_next_event(ACE_Time_Value(0, 10 * 1000));
+
+ std::cout << "Supplier initialized." << std::endl;
+ }
+
+ virtual ~TestSupplier() {
+ std::cout << "~TestSupplier()" << std::endl;
+ }
+
+ void schedule_next_event(const ACE_Time_Value& tv) {
+ reactor_->schedule_timer(this, 0, tv, ACE_Time_Value::zero);
+ }
+
+ virtual void disconnect_push_supplier() throw (CORBA::SystemException) {
+ // this should never be called. The notify service uses this to allow its
+ // clients to disconnect gracefully.
+ std::cout << "disconnect_push_supplier()." << std::endl;
+ //ACE_ASSERT(false);
+ }
+
+ bool push_next_event() {
+ try {
+ if (! connected_) {
+ std::cout << "Trying to push when disconnected." << std::endl;
+ return false;
+ }
+ std::cout << "+" << std::flush;
+
+ ++event_count_;
+
+ CORBA::Any a;
+ a <<= event_;
+ consumer_->push(a);
+
+ if (event_count_ >= num_events_ && num_events_ > 0) {
+ std::cout << "Supplier stopping after sending "
+ << event_count_ << " events." << std::endl;
+ disconnect();
+ } else {
+ schedule_next_event(EVENT_DELAY);
+ }
+ return true;
+ } catch(const CORBA::Exception& e) {
+ std::cerr << "TestSupplier::push_next_event() exception: " << e << std::endl;
+ }
+ return false;
+ }
+
+ void disconnect() {
+ try {
+ std::cout << "Supplier Disconnecting..." << std::endl;
+ consumer_->disconnect_push_consumer();
+ disconnect_self();
+ orb_->shutdown(0);
+ std::cout << "Supplier Disconnected." << std::endl;
+ } catch(const CORBA::Exception& e) {
+ std::cerr << "TestSupplier::disconnect() exception: " << e << std::endl;
+ }
+ }
+
+ void disconnect_self() {
+ if (! connected_)
+ return;
+ connected_ = false;
+ reactor_->cancel_timer(this);
+ poa_->deactivate_object(id_.in());
+ }
+
+ virtual int handle_timeout (const ACE_Time_Value&, const void*) {
+ if (! push_next_event()) {
+ return -1;
+ }
+ return 0;
+ }
+};
+
+int ACE_TMAIN (int ac, ACE_TCHAR* av[]) {
+
+ int num_events = 0;
+ int pay_size = 1;
+
+ try {
+
+ CORBA::ORB_var orb = CORBA::ORB_init(ac, av);
+
+ CORBA::ValueFactoryBase_var vfb = new MyEventFactory;
+ CORBA::String_var id = _tc_MyEvent->id();
+ orb->register_value_factory(id.in(), vfb);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+
+ obj = orb->string_to_object(notify_ior);
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf
+ = CosNotifyChannelAdmin::EventChannelFactory::_narrow(obj.in());
+ if (CORBA::is_nil(ecf.in()))
+ throw std::runtime_error("no event channel factory");
+
+ if (ac > 1) {
+ num_events = ACE_OS::atoi(av[1]);
+ }
+ if (ac > 2) {
+ pay_size = ACE_OS::atoi(av[1]);
+ }
+
+ event_ = new MyEvent_i("TestName", 42);
+
+ for (int i = 0; i < pay_size; ++i) {
+ event_->add_long((i + 1) * 42);
+ }
+
+ // Activate the manager in case the notify service wants to call us
+ // back when we register.
+ mgr->activate();
+
+ {
+ TestSupplier supplier(num_events, ecf.in(), orb.in(), poa.in());
+ orb->run();
+ }
+
+ event_ = 0;
+
+ poa->destroy(1, 1);
+ orb->destroy();
+
+ return 0;
+
+ } catch(CORBA::Exception& e) {
+ std::cerr << "Supplier: main() exception: " << e << std::endl;
+ } catch(std::invalid_argument& e) {
+ std::cerr << "Supplier: main() exception: " << e.what () << std::endl;
+ } catch(std::runtime_error& e) {
+ std::cerr << "Supplier: main() exception: " << e.what () << std::endl;
+ } catch(...) {
+ std::cerr << "Supplier: main() unknown exception: " << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/DevGuideExamples/devguide_examples.lst b/TAO/DevGuideExamples/devguide_examples.lst
new file mode 100644
index 00000000000..3611b201a57
--- /dev/null
+++ b/TAO/DevGuideExamples/devguide_examples.lst
@@ -0,0 +1,47 @@
+TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl: !MINIMUM !CORBA_E_MICRO
+TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/EventServices/OMG_SupplierSideEC/run_test.pl: !MINIMUM !NO_MESSAGING
+TAO/DevGuideExamples/EventServices/OMG_TypedEC/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/EventServices/RTEC_Basic/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/EventServices/RTEC_Federated/run_test.pl: !ST !NO_MESSAGING
+TAO/DevGuideExamples/EventServices/RTEC_Filter/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/EventServices/RTEC_MCast_Federated/run_test.pl: !NO_MCAST !NO_MESSAGING
+TAO/DevGuideExamples/GettingStarted/run_test.pl:
+TAO/DevGuideExamples/ImplRepo/run_test.pl: !MINIMUM !STATIC !CORBA_E_MICRO
+TAO/DevGuideExamples/InterfaceRepo/run_test.pl: !MINIMUM !NO_IFR
+TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl:
+TAO/DevGuideExamples/LocalObjects/ServantLocator/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/Messaging/AMIcallback/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/Messaging/RelativeRoundtripTimeout/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/NamingService/Messenger/run_test.pl:
+TAO/DevGuideExamples/NamingService/Naming_Client/run_test.pl:
+TAO/DevGuideExamples/NamingService/Naming_Context_Ext/run_test.pl:
+TAO/DevGuideExamples/NamingService/Naming_Server/run_test.pl: !ST !NO_MCAST !NO_MESSAGING
+TAO/DevGuideExamples/NamingService/corbaloc_Messenger/run_test.pl:
+TAO/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl:
+TAO/DevGuideExamples/NotifyService/EventSequence/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/NotifyService/Filtering/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/NotifyService/Messenger/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/NotifyService/OfferSubscriptions/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/NotifyService/QoSProperties/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/NotifyService/SupplierSideNC/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/NotifyService/RTNotify/run_test.pl: !ST !MINIMUM !STATIC
+TAO/DevGuideExamples/PortableInterceptors/Auth/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/PortableInterceptors/IOR/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/PortableInterceptors/PICurrent/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/RTCORBA/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !STATIC
+TAO/DevGuideExamples/Security/ParticipatingApp/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/Security/PolicyControllingApp/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/Security/SecurityUnawareApp/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS
+TAO/DevGuideExamples/SmartProxies/run_test.pl: !NO_SMARTPROXIES !NO_MESSAGING
+TAO/DevGuideExamples/Multithreading/Reactive/run_test.pl: !STATIC !MINIMUM
+TAO/DevGuideExamples/Multithreading/ThreadPerConnection/run_test.pl: !ST
+TAO/DevGuideExamples/Multithreading/ThreadPool/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/ValueTypes/Messenger/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/ValueTypes/Notify/run_test.pl: !ST !MINIMUM
+TAO/DevGuideExamples/ValueTypes/Bank/run_test.pl: !MINIMUM
+TAO/DevGuideExamples/AMH/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/AMH_AMI/run_test.pl: !NO_MESSAGING
+TAO/DevGuideExamples/CIAO/Messenger/descriptors/run_test.pl: CIAO
diff --git a/TAO/DevGuideExamples/readme.txt b/TAO/DevGuideExamples/readme.txt
new file mode 100644
index 00000000000..9f6e9699e07
--- /dev/null
+++ b/TAO/DevGuideExamples/readme.txt
@@ -0,0 +1,34 @@
+"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."
+
+--MPC--
+
+Generate GNU Makefiles
+
+$ACE_ROOT/bin/mwc.pl -type gnuace DevGuideExamples.mwc
+
+Generate Visual C++ 7.1 Workspace and Projects
+%ACE_ROOT%\bin\mwc.pl -type vc71 DevGuideExamples.mwc
+
+Generate Visual C++ 8 Workspace and Projects
+%ACE_ROOT%\bin\mwc.pl -type vc8 DevGuideExamples.mwc
+
+
+--Windows--
+* To run the release version of a test specify the following:
+ run_test.pl -ExeSubDir Release
+* The BiDirectionalGIOP projects can be referenced as an example of how to use
+ Automatic Precompiled Headers
+* The GettingStarted projects can be referenced as an example of how to use
+ Manual Precompiled Headers
+